akhaliq HF staff commited on
Commit
596c382
1 Parent(s): 30d77b6

add example

Browse files
Files changed (2) hide show
  1. app.py +8 -2
  2. examples/lemur.jpg +0 -0
app.py CHANGED
@@ -86,16 +86,22 @@ def predict_depth(input_image):
86
  if temp_file and os.path.exists(temp_file):
87
  os.remove(temp_file)
88
 
 
 
 
 
 
89
  # Create Gradio interface
90
  iface = gr.Interface(
91
  fn=predict_depth,
92
  inputs=gr.Image(type="filepath"),
93
  outputs=[
94
- gr.Image(type="filepath", label="Inverse Depth Map", height=768, width=768), # Set a reasonable display size
95
  gr.Textbox(label="Focal Length or Error Message")
96
  ],
97
  title="DepthPro Demo",
98
- description="[DepthPro](https://huggingface.co/apple/DepthPro) is a fast metric depth prediction model. Simply upload an image to predict its inverse depth map and focal length. Large images will be automatically resized to 1536x1536 pixels."
 
99
  )
100
 
101
  # Launch the interface
 
86
  if temp_file and os.path.exists(temp_file):
87
  os.remove(temp_file)
88
 
89
+ # Example images
90
+ example_images = [
91
+ "examples/lemur.jpg",
92
+ ]
93
+
94
  # Create Gradio interface
95
  iface = gr.Interface(
96
  fn=predict_depth,
97
  inputs=gr.Image(type="filepath"),
98
  outputs=[
99
+ gr.Image(type="filepath", label="Inverse Depth Map", height=768, width=768),
100
  gr.Textbox(label="Focal Length or Error Message")
101
  ],
102
  title="DepthPro Demo",
103
+ description="[DepthPro](https://huggingface.co/apple/DepthPro) is a fast metric depth prediction model. Simply upload an image to predict its inverse depth map and focal length. Large images will be automatically resized to 1536x1536 pixels.",
104
+ examples=example_images
105
  )
106
 
107
  # Launch the interface
examples/lemur.jpg ADDED