jhj0517
commited on
Commit
•
64c7f5d
1
Parent(s):
2ecaacd
fix path bug
Browse files- musepose_inference.py +3 -3
- pose_align.py +3 -3
musepose_inference.py
CHANGED
@@ -44,7 +44,7 @@ class MusePoseInference:
|
|
44 |
self.image_enc = None
|
45 |
self.pipe = None
|
46 |
self.model_dir = model_dir
|
47 |
-
self.output_dir = output_dir
|
48 |
if not os.path.exists(self.output_dir):
|
49 |
os.makedirs(self.output_dir)
|
50 |
|
@@ -83,8 +83,8 @@ class MusePoseInference:
|
|
83 |
image_file_name = os.path.splitext(os.path.basename(ref_image_path))[0]
|
84 |
pose_video_file_name = os.path.splitext(os.path.basename(pose_video_path))[0]
|
85 |
output_file_name = f"img_{image_file_name}_pose_{pose_video_file_name}"
|
86 |
-
output_path = os.path.abspath(os.path.join(self.output_dir,
|
87 |
-
output_path_demo = os.path.abspath(os.path.join(self.output_dir,
|
88 |
|
89 |
if weight_dtype == "fp16":
|
90 |
weight_dtype = torch.float16
|
|
|
44 |
self.image_enc = None
|
45 |
self.pipe = None
|
46 |
self.model_dir = model_dir
|
47 |
+
self.output_dir = os.path.join(output_dir, "musepose_inference")
|
48 |
if not os.path.exists(self.output_dir):
|
49 |
os.makedirs(self.output_dir)
|
50 |
|
|
|
83 |
image_file_name = os.path.splitext(os.path.basename(ref_image_path))[0]
|
84 |
pose_video_file_name = os.path.splitext(os.path.basename(pose_video_path))[0]
|
85 |
output_file_name = f"img_{image_file_name}_pose_{pose_video_file_name}"
|
86 |
+
output_path = os.path.abspath(os.path.join(self.output_dir, f'{output_file_name}.mp4'))
|
87 |
+
output_path_demo = os.path.abspath(os.path.join(self.output_dir, f'{output_file_name}_demo.mp4'))
|
88 |
|
89 |
if weight_dtype == "fp16":
|
90 |
weight_dtype = torch.float16
|
pose_align.py
CHANGED
@@ -32,7 +32,7 @@ class PoseAlignmentInference:
|
|
32 |
"det_config": os.path.join("pose", "config", "yolox_l_8xb8-300e_coco.py"),
|
33 |
}
|
34 |
self.model_dir = model_dir
|
35 |
-
self.output_dir = output_dir
|
36 |
if not os.path.exists(self.output_dir):
|
37 |
os.makedirs(self.output_dir)
|
38 |
|
@@ -48,8 +48,8 @@ class PoseAlignmentInference:
|
|
48 |
download_models(model_dir=self.model_dir)
|
49 |
img_file_name = os.path.splitext(os.path.basename(imgfn_refer))[0]
|
50 |
vid_file_name = os.path.splitext(os.path.basename(vidfn))[0]
|
51 |
-
outfn=os.path.abspath(os.path.join(self.output_dir,
|
52 |
-
outfn_align_pose_video=os.path.abspath(os.path.join(self.output_dir,
|
53 |
|
54 |
video = cv2.VideoCapture(vidfn)
|
55 |
width= video.get(cv2.CAP_PROP_FRAME_WIDTH)
|
|
|
32 |
"det_config": os.path.join("pose", "config", "yolox_l_8xb8-300e_coco.py"),
|
33 |
}
|
34 |
self.model_dir = model_dir
|
35 |
+
self.output_dir = os.path.join(output_dir, "pose_alignment")
|
36 |
if not os.path.exists(self.output_dir):
|
37 |
os.makedirs(self.output_dir)
|
38 |
|
|
|
48 |
download_models(model_dir=self.model_dir)
|
49 |
img_file_name = os.path.splitext(os.path.basename(imgfn_refer))[0]
|
50 |
vid_file_name = os.path.splitext(os.path.basename(vidfn))[0]
|
51 |
+
outfn=os.path.abspath(os.path.join(self.output_dir, f'img_{img_file_name}_vid_{vid_file_name}_demo.mp4'))
|
52 |
+
outfn_align_pose_video=os.path.abspath(os.path.join(self.output_dir, f'img_{img_file_name}_vid_{vid_file_name}.mp4'))
|
53 |
|
54 |
video = cv2.VideoCapture(vidfn)
|
55 |
width= video.get(cv2.CAP_PROP_FRAME_WIDTH)
|