From 982ff8d8ea1c7656799bb6a4070a3609887963b7 Mon Sep 17 00:00:00 2001 From: Dhruv Arora <64625973+6DEADSHOT9@users.noreply.github.com> Date: Sat, 14 Oct 2023 03:55:45 +0530 Subject: [PATCH 1/2] Add files via upload --- inference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inference.py b/inference.py index a0b00790..234d5a8a 100644 --- a/inference.py +++ b/inference.py @@ -17,7 +17,7 @@ def main(args): pic_path = args.source_image audio_path = args.driven_audio - save_dir = os.path.join(args.result_dir, strftime("%Y_%m_%d_%H.%M.%S")) + save_dir = os.path.join(args.result_dir, args.result_name) os.makedirs(save_dir, exist_ok=True) pose_style = args.pose_style device = args.device @@ -103,6 +103,7 @@ def main(args): parser.add_argument("--ref_pose", default=None, help="path to reference video providing pose") parser.add_argument("--checkpoint_dir", default='./checkpoints', help="path to output") parser.add_argument("--result_dir", default='./results', help="path to output") + parser.add_argument("--result_name", default='out', help="file name to output") parser.add_argument("--pose_style", type=int, default=0, help="input pose style from [0, 46)") parser.add_argument("--batch_size", type=int, default=2, help="the batch size of facerender") parser.add_argument("--size", type=int, default=256, help="the image size of the facerender") From fe3b791c5e2b6c351d088a463484fb4406b92128 Mon Sep 17 00:00:00 2001 From: Dhruv Arora <64625973+6DEADSHOT9@users.noreply.github.com> Date: Sat, 14 Oct 2023 07:50:26 +0530 Subject: [PATCH 2/2] Update paste_pic.py --- src/utils/paste_pic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/paste_pic.py b/src/utils/paste_pic.py index f9989e21..bef306c8 100644 --- a/src/utils/paste_pic.py +++ b/src/utils/paste_pic.py @@ -54,7 +54,7 @@ def paste_pic(video_path, pic_path, crop_info, new_audio_path, full_video_path, oy1, oy2, ox1, ox2 = cly+ly, cly+ry, clx+lx, clx+rx tmp_path = str(uuid.uuid4())+'.mp4' - out_tmp = cv2.VideoWriter(tmp_path, cv2.VideoWriter_fourcc(*'MP4V'), fps, (frame_w, frame_h)) + out_tmp = cv2.VideoWriter(tmp_path, cv2.VideoWriter_fourcc(*'mp4v'), fps, (frame_w, frame_h)) for crop_frame in tqdm(crop_frames, 'seamlessClone:'): p = cv2.resize(crop_frame.astype(np.uint8), (ox2-ox1, oy2 - oy1))