new config
Browse files- main_noweb.py +7 -3
main_noweb.py
CHANGED
@@ -15,6 +15,7 @@ import moviepy.editor as moviepy
|
|
15 |
import os
|
16 |
import glob
|
17 |
import uuid
|
|
|
18 |
|
19 |
# Image manipulation
|
20 |
import numpy as np
|
@@ -30,7 +31,7 @@ else:
|
|
30 |
os.system("nvidia-smi")
|
31 |
|
32 |
print("[INFO]: Imported modules!")
|
33 |
-
human = MMPoseInferencer(
|
34 |
hand = MMPoseInferencer("hand")
|
35 |
human3d = MMPoseInferencer(pose3d="human3d")
|
36 |
track_model = YOLO('yolov8n.pt') # Load an official Detect model
|
@@ -161,7 +162,10 @@ def pose2d(video, kpt_threshold):
|
|
161 |
print(glob.glob(os.path.join(add_dir, "*.json")))
|
162 |
print(os.listdir(add_dir))
|
163 |
|
164 |
-
|
|
|
|
|
|
|
165 |
|
166 |
|
167 |
def pose2dhand(video, kpt_threshold):
|
@@ -196,7 +200,7 @@ with block:
|
|
196 |
with gr.Column():
|
197 |
with gr.Row():
|
198 |
with gr.Column():
|
199 |
-
video_input = gr.Video(source="upload", type="filepath", height=
|
200 |
# Insert slider with kpt_thr
|
201 |
file_kpthr = gr.Slider(0, 1, value=0.3, label='Keypoint threshold')
|
202 |
with gr.Row():
|
|
|
15 |
import os
|
16 |
import glob
|
17 |
import uuid
|
18 |
+
import json
|
19 |
|
20 |
# Image manipulation
|
21 |
import numpy as np
|
|
|
31 |
os.system("nvidia-smi")
|
32 |
|
33 |
print("[INFO]: Imported modules!")
|
34 |
+
human = MMPoseInferencer("dekr_hrnet-w32_8xb10-140e_coco-512x512.py")
|
35 |
hand = MMPoseInferencer("hand")
|
36 |
human3d = MMPoseInferencer(pose3d="human3d")
|
37 |
track_model = YOLO('yolov8n.pt') # Load an official Detect model
|
|
|
162 |
print(glob.glob(os.path.join(add_dir, "*.json")))
|
163 |
print(os.listdir(add_dir))
|
164 |
|
165 |
+
with open('path_to_file/person.json', 'r') as f:
|
166 |
+
data = json.load(kpoints)
|
167 |
+
|
168 |
+
return "".join(out_file), data # "".join(kpoints)
|
169 |
|
170 |
|
171 |
def pose2dhand(video, kpt_threshold):
|
|
|
200 |
with gr.Column():
|
201 |
with gr.Row():
|
202 |
with gr.Column():
|
203 |
+
video_input = gr.Video(source="upload", type="filepath", height=512, width=512)
|
204 |
# Insert slider with kpt_thr
|
205 |
file_kpthr = gr.Slider(0, 1, value=0.3, label='Keypoint threshold')
|
206 |
with gr.Row():
|