xmrt commited on
Commit
6f5693c
·
1 Parent(s): 8a3333b
Files changed (1) hide show
  1. main.py +27 -14
main.py CHANGED
@@ -147,59 +147,72 @@ with gr.Blocks() as demo:
147
  with gr.Row():
148
  with gr.Column():
149
  video_input = gr.Video(source="upload", type="filepath", height=512)
 
 
 
150
 
151
  submit_pose_file = gr.Button("Make 2d pose estimation")
152
  submit_pose3d_file = gr.Button("Make 3d pose estimation")
153
  submit_hand_file = gr.Button("Make 2d hand estimation")
154
  submit_detect_file = gr.Button("Detect and track objects")
155
 
156
- video_output = gr.Video(height=512)
 
 
 
157
 
158
  with gr.Tab("Record video with webcam"):
159
  with gr.Row():
160
  with gr.Column():
161
  webcam_input = gr.Video(source="webcam", height=512)
162
 
 
 
 
163
  submit_pose_web = gr.Button("Make 2d pose estimation")
164
  submit_pose3d_web = gr.Button("Make 3d pose estimation")
165
  submit_hand_web = gr.Button("Make 2d hand estimation")
166
  submit_detect_web = gr.Button("Detect and track objects")
167
 
168
- webcam_output = gr.Video(height=512)
 
 
 
 
169
 
170
 
171
  # From file
172
  submit_pose_file.click(fn=pose2d,
173
  inputs= video_input,
174
- outputs = video_output)
175
 
176
  submit_pose3d_file.click(fn=pose3d,
177
  inputs= video_input,
178
- outputs = video_output)
179
 
180
  submit_hand_file.click(fn=pose2dhand,
181
  inputs= video_input,
182
- outputs = video_output)
183
 
184
  submit_detect_file.click(fn=show_tracking,
185
  inputs= video_input,
186
- outputs = video_output)
187
 
188
  # Web
189
  submit_pose_web.click(fn=pose2d,
190
- inputs= video_input,
191
- outputs = video_output)
192
 
193
  submit_pose3d_web.click(fn=pose3d,
194
- inputs= video_input,
195
- outputs = video_output)
196
 
197
  submit_hand_web.click(fn=pose2dhand,
198
- inputs= video_input,
199
- outputs = video_output)
200
 
201
  submit_detect_web.click(fn=show_tracking,
202
- inputs= video_input,
203
- outputs = video_output)
204
 
205
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
147
  with gr.Row():
148
  with gr.Column():
149
  video_input = gr.Video(source="upload", type="filepath", height=512)
150
+ # Insert slider with kpt_thr
151
+ web_kpthr = gr.Slider(0, 1, value=0.3)
152
+ file_kpthr = gr.Slider(0, 1, value=0.3)
153
 
154
  submit_pose_file = gr.Button("Make 2d pose estimation")
155
  submit_pose3d_file = gr.Button("Make 3d pose estimation")
156
  submit_hand_file = gr.Button("Make 2d hand estimation")
157
  submit_detect_file = gr.Button("Detect and track objects")
158
 
159
+ video_output1 = gr.Video(height=512)
160
+ video_output2 = gr.Video(height=512)
161
+ video_output3 = gr.Video(height=512)
162
+ video_output4 = gr.Video(height=512)
163
 
164
  with gr.Tab("Record video with webcam"):
165
  with gr.Row():
166
  with gr.Column():
167
  webcam_input = gr.Video(source="webcam", height=512)
168
 
169
+ web_kpthr = gr.Slider(0, 1, value=0.3)
170
+ file_kpthr = gr.Slider(0, 1, value=0.3)
171
+
172
  submit_pose_web = gr.Button("Make 2d pose estimation")
173
  submit_pose3d_web = gr.Button("Make 3d pose estimation")
174
  submit_hand_web = gr.Button("Make 2d hand estimation")
175
  submit_detect_web = gr.Button("Detect and track objects")
176
 
177
+ webcam_output1 = gr.Video(height=512)
178
+ webcam_output2 = gr.Video(height=512)
179
+ webcam_output3 = gr.Video(height=512)
180
+ webcam_output4 = gr.Video(height=512)
181
+
182
 
183
 
184
  # From file
185
  submit_pose_file.click(fn=pose2d,
186
  inputs= video_input,
187
+ outputs = video_output1)
188
 
189
  submit_pose3d_file.click(fn=pose3d,
190
  inputs= video_input,
191
+ outputs = video_output2)
192
 
193
  submit_hand_file.click(fn=pose2dhand,
194
  inputs= video_input,
195
+ outputs = video_output3)
196
 
197
  submit_detect_file.click(fn=show_tracking,
198
  inputs= video_input,
199
+ outputs = video_output4)
200
 
201
  # Web
202
  submit_pose_web.click(fn=pose2d,
203
+ inputs= webcam_input,
204
+ outputs = webcam_output1)
205
 
206
  submit_pose3d_web.click(fn=pose3d,
207
+ inputs= webcam_input,
208
+ outputs = webcam_output2)
209
 
210
  submit_hand_web.click(fn=pose2dhand,
211
+ inputs= webcam_input,
212
+ outputs = video_output3)
213
 
214
  submit_detect_web.click(fn=show_tracking,
215
+ inputs= webcam_input,
216
+ outputs = video_output4)
217
 
218
  demo.launch(server_name="0.0.0.0", server_port=7860)