keivalya commited on
Commit
f7fa060
·
verified ·
1 Parent(s): f54cbf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -17,6 +17,9 @@ transform = T.Compose([
17
  T.ToTensor(),
18
  ])
19
 
 
 
 
20
  def predict_depth(image):
21
  img = transform(image).unsqueeze(0).to(device)
22
  with torch.no_grad():
@@ -26,14 +29,14 @@ def predict_depth(image):
26
  return [image, pred_image]
27
 
28
  # Gradio UI
29
- examples = [["example.png"]]
30
 
31
  demo = gr.Interface(
32
  fn=predict_depth,
33
- inputs=gr.Image(type="pil", label="Input RGB Image"),
34
  outputs=[
35
- gr.Image(type="pil", label="Original Image"),
36
- gr.Image(type="pil", label="Predicted Depth Map"),
37
  ],
38
  title="🔭 DepthStar: Light-weight Depth Estimation",
39
  description="Upload an RGB image and get the depth map predicted by our tiny DepthStar model.",
 
17
  T.ToTensor(),
18
  ])
19
 
20
+ # Larger output display
21
+ image_output_size = 512
22
+
23
  def predict_depth(image):
24
  img = transform(image).unsqueeze(0).to(device)
25
  with torch.no_grad():
 
29
  return [image, pred_image]
30
 
31
  # Gradio UI
32
+ examples = [["img_000.png"],["img_001.png"],["img_002.png"],["img_003.png"],["img_004.png"],["img_005.png"],]
33
 
34
  demo = gr.Interface(
35
  fn=predict_depth,
36
+ inputs=gr.Image(type="pil", label="Input RGB Image", tool="editor", height=image_output_size),
37
  outputs=[
38
+ gr.Image(type="pil", label="Original Image", height=image_output_size),
39
+ gr.Image(type="pil", label="Predicted Depth Map", height=image_output_size),
40
  ],
41
  title="🔭 DepthStar: Light-weight Depth Estimation",
42
  description="Upload an RGB image and get the depth map predicted by our tiny DepthStar model.",