markdown slider and max threads
Browse files- main_noweb.py +9 -8
main_noweb.py
CHANGED
|
@@ -120,7 +120,7 @@ def pose3d(video, kpt_threshold):
|
|
| 120 |
print(kpoints)
|
| 121 |
|
| 122 |
# Reinitialize
|
| 123 |
-
return "".join(out_file)
|
| 124 |
|
| 125 |
|
| 126 |
def pose2d(video, kpt_threshold):
|
|
@@ -129,7 +129,6 @@ def pose2d(video, kpt_threshold):
|
|
| 129 |
|
| 130 |
# Define new unique folder
|
| 131 |
add_dir = str(uuid.uuid4())
|
| 132 |
-
vis_out_dir = os.path.join("/".join(video.split("/")[:-1]), add_dir)
|
| 133 |
|
| 134 |
os.makedirs(add_dir)
|
| 135 |
print(check_fps(video))
|
|
@@ -160,23 +159,25 @@ def pose2dhand(video, kpt_threshold):
|
|
| 160 |
|
| 161 |
# Define new unique folder
|
| 162 |
add_dir = str(uuid.uuid4())
|
| 163 |
-
|
| 164 |
-
os.makedirs(vis_out_dir)
|
| 165 |
|
| 166 |
result_generator = hand(video,
|
| 167 |
-
vis_out_dir =
|
| 168 |
-
return_vis=True,
|
| 169 |
thickness = 4,
|
| 170 |
radius = 5,
|
| 171 |
rebase_keypoint_height=True,
|
| 172 |
kpt_thr=kpt_threshold,
|
|
|
|
|
|
|
| 173 |
device=device)
|
| 174 |
|
| 175 |
result = [result for result in result_generator] #next(result_generator)
|
| 176 |
|
| 177 |
-
out_file = glob.glob(os.path.join(
|
|
|
|
|
|
|
| 178 |
|
| 179 |
-
return "".join(out_file)
|
| 180 |
|
| 181 |
def UI():
|
| 182 |
block = gr.Blocks()
|
|
|
|
| 120 |
print(kpoints)
|
| 121 |
|
| 122 |
# Reinitialize
|
| 123 |
+
return "".join(out_file), "".join(kpoints)
|
| 124 |
|
| 125 |
|
| 126 |
def pose2d(video, kpt_threshold):
|
|
|
|
| 129 |
|
| 130 |
# Define new unique folder
|
| 131 |
add_dir = str(uuid.uuid4())
|
|
|
|
| 132 |
|
| 133 |
os.makedirs(add_dir)
|
| 134 |
print(check_fps(video))
|
|
|
|
| 159 |
|
| 160 |
# Define new unique folder
|
| 161 |
add_dir = str(uuid.uuid4())
|
| 162 |
+
os.makedirs(add_dir)
|
|
|
|
| 163 |
|
| 164 |
result_generator = hand(video,
|
| 165 |
+
vis_out_dir = add_dir,
|
|
|
|
| 166 |
thickness = 4,
|
| 167 |
radius = 5,
|
| 168 |
rebase_keypoint_height=True,
|
| 169 |
kpt_thr=kpt_threshold,
|
| 170 |
+
pred_out_dir = add_dir,
|
| 171 |
+
|
| 172 |
device=device)
|
| 173 |
|
| 174 |
result = [result for result in result_generator] #next(result_generator)
|
| 175 |
|
| 176 |
+
out_file = glob.glob(os.path.join(add_dir, "*.mp4")) #+ glob.glob(os.path.join(vis_out_dir, "*.webm"))
|
| 177 |
+
kpoints = glob.glob(os.path.join(add_dir, "*.json"))
|
| 178 |
+
|
| 179 |
|
| 180 |
+
return "".join(out_file), "".join(kpoints)
|
| 181 |
|
| 182 |
def UI():
|
| 183 |
block = gr.Blocks()
|