haofeixu commited on
Commit
eaa2589
1 Parent(s): 03e1fbc

make examples more clear

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -136,25 +136,23 @@ def inference(image1, image2, task='flow'):
136
 
137
  title = "UniMatch"
138
 
139
- description = "<p style='text-align: center'>Optical flow and stereo matching demo for <a href='https://haofeixu.github.io/unimatch/' target='_blank'>Unifying Flow, Stereo and Depth Estimation</a> | <a href='https://arxiv.org/abs/2211.05783' target='_blank'>Paper</a> | <a href='https://github.com/autonomousvision/unimatch' target='_blank'>Code</a> | <a href='https://colab.research.google.com/drive/1r5m-xVy3Kw60U-m5VB-aQ98oqqg_6cab?usp=sharing' target='_blank'>Colab</a><br>Simply upload your images or click one of the provided examples.<br>The <strong>first three</strong> examples are video frames for <strong>flow</strong> task, and the <strong>last three</strong> are stereo pairs for <strong>stereo</strong> task.<br><strong>Select the task type according to your input images</strong>.</p>"
140
 
141
  examples = [
142
- ['demo/flow_kitti_test_000197_10.png', 'demo/flow_kitti_test_000197_11.png'],
143
- ['demo/flow_sintel_cave_3_frame_0049.png', 'demo/flow_sintel_cave_3_frame_0050.png'],
144
- ['demo/flow_davis_skate-jump_00059.jpg', 'demo/flow_davis_skate-jump_00060.jpg'],
145
  ['demo/stereo_drivingstereo_test_2018-07-11-14-48-52_2018-07-11-14-58-34-673_left.jpg',
146
- 'demo/stereo_drivingstereo_test_2018-07-11-14-48-52_2018-07-11-14-58-34-673_right.jpg'],
147
- ['demo/stereo_middlebury_plants_im0.png', 'demo/stereo_middlebury_plants_im1.png'],
148
- ['demo/stereo_holopix_left.png', 'demo/stereo_holopix_right.png']
 
 
 
149
  ]
150
 
151
  gr.Interface(
152
  inference,
153
  [gr.Image(type="pil", label="Image1"), gr.Image(type="pil", label="Image2"), gr.Radio(choices=['flow', 'stereo'], value='flow', label='Task')],
154
- gr.Image(type="pil", label="Flow/Disparity"),
155
  title=title,
156
  description=description,
157
  examples=examples,
158
- thumbnail="https://haofeixu.github.io/unimatch/resources/teaser.svg",
159
- allow_flagging="auto",
160
- ).launch(debug=True)
 
136
 
137
  title = "UniMatch"
138
 
139
+ description = "<p style='text-align: center'>Optical flow and stereo matching demo for <a href='https://haofeixu.github.io/unimatch/' target='_blank'>Unifying Flow, Stereo and Depth Estimation</a> | <a href='https://arxiv.org/abs/2211.05783' target='_blank'>Paper</a> | <a href='https://github.com/autonomousvision/unimatch' target='_blank'>Code</a> | <a href='https://colab.research.google.com/drive/1r5m-xVy3Kw60U-m5VB-aQ98oqqg_6cab?usp=sharing' target='_blank'>Colab</a><br>Task <strong>flow</strong>: Image1: <strong>video frame t</strong>, Image2: <strong>video frame t+1</strong>; Task <strong>stereo</strong>: Image1: <strong>left</strong> image, Image2: <strong>right</strong> image<br>Simply upload your images or click one of the provided examples.<br><strong>Select the task type according to your input images</strong>.</p>"
140
 
141
  examples = [
 
 
 
142
  ['demo/stereo_drivingstereo_test_2018-07-11-14-48-52_2018-07-11-14-58-34-673_left.jpg',
143
+ 'demo/stereo_drivingstereo_test_2018-07-11-14-48-52_2018-07-11-14-58-34-673_right.jpg', 'stereo'],
144
+ ['demo/stereo_middlebury_plants_im0.png', 'demo/stereo_middlebury_plants_im1.png', 'stereo'],
145
+ ['demo/stereo_holopix_left.png', 'demo/stereo_holopix_right.png', 'stereo'],
146
+ ['demo/flow_kitti_test_000197_10.png', 'demo/flow_kitti_test_000197_11.png', 'flow'],
147
+ ['demo/flow_sintel_cave_3_frame_0049.png', 'demo/flow_sintel_cave_3_frame_0050.png', 'flow'],
148
+ ['demo/flow_davis_skate-jump_00059.jpg', 'demo/flow_davis_skate-jump_00060.jpg', 'flow']
149
  ]
150
 
151
  gr.Interface(
152
  inference,
153
  [gr.Image(type="pil", label="Image1"), gr.Image(type="pil", label="Image2"), gr.Radio(choices=['flow', 'stereo'], value='flow', label='Task')],
154
+ gr.Image(type="pil", label="flow/disparity"),
155
  title=title,
156
  description=description,
157
  examples=examples,
158
+ ).launch(debug=True, quiet=True)