text2video
Browse files
Source Code/annotator/openpose/__init__.py
CHANGED
|
@@ -18,8 +18,18 @@ class OpenposeDetector:
|
|
| 18 |
body_modelpath = os.path.join(annotator_ckpts_path, "body_pose_model.pth")
|
| 19 |
hand_modelpath = os.path.join(annotator_ckpts_path, "hand_pose_model.pth")
|
| 20 |
|
| 21 |
-
if not os.path.exists(
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
self.body_estimation = Body(body_modelpath)
|
| 25 |
self.hand_estimation = Hand(hand_modelpath)
|
|
|
|
| 18 |
body_modelpath = os.path.join(annotator_ckpts_path, "body_pose_model.pth")
|
| 19 |
hand_modelpath = os.path.join(annotator_ckpts_path, "hand_pose_model.pth")
|
| 20 |
|
| 21 |
+
if not os.path.exists(annotator_ckpts_path):
|
| 22 |
+
os.makedirs(annotator_ckpts_path)
|
| 23 |
+
|
| 24 |
+
if not os.path.exists(body_modelpath):
|
| 25 |
+
from torch.hub import download_url_to_file
|
| 26 |
+
print(f"Downloading body_pose_model from {body_model_path}...")
|
| 27 |
+
download_url_to_file(body_model_path, body_modelpath)
|
| 28 |
+
|
| 29 |
+
if not os.path.exists(hand_modelpath):
|
| 30 |
+
from torch.hub import download_url_to_file
|
| 31 |
+
print(f"Downloading hand_pose_model from {hand_model_path}...")
|
| 32 |
+
download_url_to_file(hand_model_path, hand_modelpath)
|
| 33 |
|
| 34 |
self.body_estimation = Body(body_modelpath)
|
| 35 |
self.hand_estimation = Hand(hand_modelpath)
|