juhu cuda virker
Browse files
main.py
CHANGED
@@ -117,7 +117,8 @@ def pose3d(video):
|
|
117 |
|
118 |
result_generator = human3d(video,
|
119 |
vis_out_dir = vis_out_dir,
|
120 |
-
thickness=
|
|
|
121 |
return_vis=True,
|
122 |
rebase_keypoint_height=True,
|
123 |
device=device)
|
@@ -141,7 +142,8 @@ def pose2d(video, kpt_threshold):
|
|
141 |
result_generator = human(video,
|
142 |
vis_out_dir = vis_out_dir,
|
143 |
return_vis=True,
|
144 |
-
|
|
|
145 |
rebase_keypoint_height=True,
|
146 |
kpt_thr=kpt_threshold,
|
147 |
device=device
|
@@ -167,7 +169,8 @@ def pose2dhand(video, kpt_threshold):
|
|
167 |
result_generator = hand(video,
|
168 |
vis_out_dir = vis_out_dir,
|
169 |
return_vis=True,
|
170 |
-
thickness=
|
|
|
171 |
rebase_keypoint_height=True,
|
172 |
kpt_thr=kpt_threshold,
|
173 |
device=device)
|
@@ -187,7 +190,7 @@ def run_UI():
|
|
187 |
with gr.Column():
|
188 |
video_input = gr.Video(source="upload", type="filepath", height=612)
|
189 |
# Insert slider with kpt_thr
|
190 |
-
file_kpthr = gr.Slider(minimum=0.
|
191 |
|
192 |
submit_pose_file = gr.Button("Make 2d pose estimation", variant="primary")
|
193 |
submit_pose3d_file = gr.Button("Make 3d pose estimation", variant="primary")
|
@@ -207,7 +210,7 @@ def run_UI():
|
|
207 |
with gr.Column():
|
208 |
webcam_input = gr.Video(source="webcam", height=612)
|
209 |
|
210 |
-
web_kpthr = gr.Slider(minimum=0.
|
211 |
|
212 |
submit_pose_web = gr.Button("Make 2d pose estimation", variant="primary")
|
213 |
submit_pose3d_web = gr.Button("Make 3d pose estimation", variant="primary")
|
@@ -234,20 +237,23 @@ def run_UI():
|
|
234 |
gr.Markdown("""
|
235 |
\n # Information about the models
|
236 |
|
237 |
-
\n ## Pose models:
|
|
|
|
|
238 |
|
239 |
-
\n
|
240 |
|
241 |
-
\n
|
242 |
|
243 |
-
\n
|
244 |
|
245 |
-
\n
|
|
|
|
|
246 |
|
247 |
-
\n
|
248 |
|
249 |
-
\n
|
250 |
-
The tracked objects are represented as bounding boxes with labels indicating the class of the object.""")
|
251 |
|
252 |
# From file
|
253 |
submit_pose_file.click(fn=pose2d,
|
|
|
117 |
|
118 |
result_generator = human3d(video,
|
119 |
vis_out_dir = vis_out_dir,
|
120 |
+
thickness=4,
|
121 |
+
radius = 5,
|
122 |
return_vis=True,
|
123 |
rebase_keypoint_height=True,
|
124 |
device=device)
|
|
|
142 |
result_generator = human(video,
|
143 |
vis_out_dir = vis_out_dir,
|
144 |
return_vis=True,
|
145 |
+
radius = 5,
|
146 |
+
thickness=4,
|
147 |
rebase_keypoint_height=True,
|
148 |
kpt_thr=kpt_threshold,
|
149 |
device=device
|
|
|
169 |
result_generator = hand(video,
|
170 |
vis_out_dir = vis_out_dir,
|
171 |
return_vis=True,
|
172 |
+
thickness = 4,
|
173 |
+
radius = 5,
|
174 |
rebase_keypoint_height=True,
|
175 |
kpt_thr=kpt_threshold,
|
176 |
device=device)
|
|
|
190 |
with gr.Column():
|
191 |
video_input = gr.Video(source="upload", type="filepath", height=612)
|
192 |
# Insert slider with kpt_thr
|
193 |
+
file_kpthr = gr.Slider(minimum=0.000001, maximum=0.001, step=0.000001, default=0.00001, label='Keypoint threshold')
|
194 |
|
195 |
submit_pose_file = gr.Button("Make 2d pose estimation", variant="primary")
|
196 |
submit_pose3d_file = gr.Button("Make 3d pose estimation", variant="primary")
|
|
|
210 |
with gr.Column():
|
211 |
webcam_input = gr.Video(source="webcam", height=612)
|
212 |
|
213 |
+
web_kpthr = gr.Slider(minimum=0.000001, maximum=0.001, step=0.000001, default=0.00001, label='Keypoint threshold')
|
214 |
|
215 |
submit_pose_web = gr.Button("Make 2d pose estimation", variant="primary")
|
216 |
submit_pose3d_web = gr.Button("Make 3d pose estimation", variant="primary")
|
|
|
237 |
gr.Markdown("""
|
238 |
\n # Information about the models
|
239 |
|
240 |
+
\n ## Pose models:
|
241 |
+
|
242 |
+
\n All the pose estimation models comes from the library [MMpose](https://github.com/open-mmlab/mmpose). It is a library for human pose estimation that provides pre-trained models for 2D and 3D pose estimation.
|
243 |
|
244 |
+
\n The 2D pose model is used for estimating the 2D coordinates of human body joints from an image or a video frame. The model uses a convolutional neural network (CNN) to predict the joint locations and their confidence scores.
|
245 |
|
246 |
+
\n The 2D hand model is a specialized version of the 2D pose model that is designed for hand pose estimation. It uses a similar CNN architecture to the 2D pose model but is trained specifically for detecting the joints in the hand.
|
247 |
|
248 |
+
\n The 3D pose model is used for estimating the 3D coordinates of human body joints from an image or a video frame. The model uses a combination of 2D pose estimation and depth estimation to infer the 3D joint locations.
|
249 |
|
250 |
+
\n
|
251 |
+
|
252 |
+
\n ## Detection and tracking:
|
253 |
|
254 |
+
\n The tracking method in the Ultralight's YOLOv8 model is used for object tracking in videos. It takes a video file or a camera stream as input and returns the tracked objects in each frame. The method uses the COCO dataset classes for object detection and tracking.
|
255 |
|
256 |
+
\n The COCO dataset contains 80 classes of objects such as person, car, bicycle, etc. See https://docs.ultralytics.com/datasets/detect/coco/ for all available classes. The tracking method uses the COCO classes to detect and track the objects in the video frames. The tracked objects are represented as bounding boxes with labels indicating the class of the object.""")
|
|
|
257 |
|
258 |
# From file
|
259 |
submit_pose_file.click(fn=pose2d,
|