lemonaddie commited on
Commit
2f12544
1 Parent(s): 2ce2894

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -3
app.py CHANGED
@@ -14,8 +14,23 @@ from gradio_imageslider import ImageSlider
14
  import spaces
15
 
16
  @spaces.GPU
17
- def depth_normal(img):
18
- return img, img
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  # @spaces.GPU
21
  # def run_demo_server(pipe):
@@ -301,7 +316,7 @@ def main():
301
 
302
  gr.Interface(
303
  depth_normal,
304
- inputs=[gr.Image(type='pil', label="Original Image")],
305
  outputs=[gr.Image(type="pil",label="Output Depth"), gr.Image(type="pil",label="Output Normal")],
306
  title=title, description=description, article='1', examples=examples, analytics_enabled=False).launch()
307
 
 
14
  import spaces
15
 
16
  @spaces.GPU
17
+ def depth_normal(img, pipe):
18
+
19
+ pipe_out = pipe(
20
+ input_image,
21
+ denoising_steps=10,
22
+ ensemble_size=1,
23
+ processing_res=768,
24
+ batch_size=0,
25
+ guidance_scale=3,
26
+ domain="indoor",
27
+ show_progress_bar=True,
28
+ )
29
+
30
+ depth_colored = pipe_out.depth_colored
31
+ normal_colored = pipe_out.normal_colored
32
+
33
+ return depth_colored, normal_colored
34
 
35
  # @spaces.GPU
36
  # def run_demo_server(pipe):
 
316
 
317
  gr.Interface(
318
  depth_normal,
319
+ inputs=[gr.Image(type='pil', label="Original Image"), pipe],
320
  outputs=[gr.Image(type="pil",label="Output Depth"), gr.Image(type="pil",label="Output Normal")],
321
  title=title, description=description, article='1', examples=examples, analytics_enabled=False).launch()
322