jhj0517 commited on
Commit
2d1f579
1 Parent(s): 1d6c461

set output file name and duration to 450

Browse files
Files changed (2) hide show
  1. musepose_inference.py +4 -5
  2. pose_align.py +4 -5
musepose_inference.py CHANGED
@@ -50,6 +50,7 @@ class MusePoseInference:
50
  if not os.path.exists(self.output_dir):
51
  os.makedirs(self.output_dir)
52
 
 
53
  def infer_musepose(
54
  self,
55
  ref_image_path: str,
@@ -82,11 +83,9 @@ class MusePoseInference:
82
  print(f"FPS: {fps}")
83
  print(f"Skip: {skip}")
84
 
85
- image_file_name = os.path.splitext(os.path.basename(ref_image_path))[0]
86
- pose_video_file_name = os.path.splitext(os.path.basename(pose_video_path))[0]
87
- output_file_name = f"img_{image_file_name}_pose_{pose_video_file_name}"
88
- output_path = os.path.abspath(os.path.join(self.output_dir, f'{output_file_name}.mp4'))
89
- output_path_demo = os.path.abspath(os.path.join(self.output_dir, f'{output_file_name}_demo.mp4'))
90
 
91
  if weight_dtype == "fp16":
92
  weight_dtype = torch.float16
 
50
  if not os.path.exists(self.output_dir):
51
  os.makedirs(self.output_dir)
52
 
53
+ @spaces.GPU(duration=450)
54
  def infer_musepose(
55
  self,
56
  ref_image_path: str,
 
83
  print(f"FPS: {fps}")
84
  print(f"Skip: {skip}")
85
 
86
+ output_filename = f"output_temp"
87
+ output_path = os.path.abspath(os.path.join(self.output_dir, f'{output_filename}.mp4'))
88
+ output_path_demo = os.path.abspath(os.path.join(self.output_dir, f'{output_filename}_demo.mp4'))
 
 
89
 
90
  if weight_dtype == "fp16":
91
  weight_dtype = torch.float16
pose_align.py CHANGED
@@ -39,7 +39,7 @@ class PoseAlignmentInference:
39
  if not os.path.exists(self.output_dir):
40
  os.makedirs(self.output_dir)
41
 
42
- @spaces.GPU(duration=120)
43
  def align_pose(
44
  self,
45
  vidfn: str,
@@ -50,10 +50,9 @@ class PoseAlignmentInference:
50
  max_frame: int,
51
  ):
52
  download_models(model_dir=self.model_dir)
53
- img_file_name = os.path.splitext(os.path.basename(imgfn_refer))[0]
54
- vid_file_name = os.path.splitext(os.path.basename(vidfn))[0]
55
- outfn=os.path.abspath(os.path.join(self.output_dir, f'img_{img_file_name}_vid_{vid_file_name}_demo.mp4'))
56
- outfn_align_pose_video=os.path.abspath(os.path.join(self.output_dir, f'img_{img_file_name}_vid_{vid_file_name}.mp4'))
57
 
58
  video = cv2.VideoCapture(vidfn)
59
  width= video.get(cv2.CAP_PROP_FRAME_WIDTH)
 
39
  if not os.path.exists(self.output_dir):
40
  os.makedirs(self.output_dir)
41
 
42
+ @spaces.GPU(duration=450)
43
  def align_pose(
44
  self,
45
  vidfn: str,
 
50
  max_frame: int,
51
  ):
52
  download_models(model_dir=self.model_dir)
53
+ output_filename = "pose_temp"
54
+ outfn=os.path.abspath(os.path.join(self.output_dir, f'{output_filename}_demo.mp4'))
55
+ outfn_align_pose_video=os.path.abspath(os.path.join(self.output_dir, f'{output_filename}.mp4'))
 
56
 
57
  video = cv2.VideoCapture(vidfn)
58
  width= video.get(cv2.CAP_PROP_FRAME_WIDTH)