Muhammad Taqi Raza
commited on
Commit
·
8f2d7c5
1
Parent(s):
a653e07
final commit
Browse files- gradio_app.py +4 -2
- inference/v2v_data/demo.py +1 -0
gradio_app.py
CHANGED
@@ -41,6 +41,8 @@ download_models()
|
|
41 |
def run_epic_inference(video_path, caption, motion_type):
|
42 |
temp_input_path = "/app/temp_input.mp4"
|
43 |
output_dir = f"/app/output_{motion_type}"
|
|
|
|
|
44 |
traj_name = motion_type
|
45 |
traj_txt = f"/app/inference/v2v_data/test/trajs/{traj_name}.txt"
|
46 |
|
@@ -83,8 +85,8 @@ def run_epic_inference(video_path, caption, motion_type):
|
|
83 |
|
84 |
# Locate the output video
|
85 |
output_video = Path(output_dir) / f"amalfi-coast_traj_{traj_name}.mp4"
|
86 |
-
if
|
87 |
-
return logs, str(
|
88 |
else:
|
89 |
return f"Inference succeeded but no output video found in {output_dir}", None
|
90 |
|
|
|
41 |
def run_epic_inference(video_path, caption, motion_type):
|
42 |
temp_input_path = "/app/temp_input.mp4"
|
43 |
output_dir = f"/app/output_{motion_type}"
|
44 |
+
|
45 |
+
video_output_path = f"{output_dir}/masked_videos/temp_input.mp4"
|
46 |
traj_name = motion_type
|
47 |
traj_txt = f"/app/inference/v2v_data/test/trajs/{traj_name}.txt"
|
48 |
|
|
|
85 |
|
86 |
# Locate the output video
|
87 |
output_video = Path(output_dir) / f"amalfi-coast_traj_{traj_name}.mp4"
|
88 |
+
if video_output_path.exists():
|
89 |
+
return logs, str(video_output_path)
|
90 |
else:
|
91 |
return f"Inference succeeded but no output video found in {output_dir}", None
|
92 |
|
inference/v2v_data/demo.py
CHANGED
@@ -130,6 +130,7 @@ class GetAnchorVideos:
|
|
130 |
window_size=opts.window_size,
|
131 |
overlap=opts.overlap,
|
132 |
).to(opts.device)
|
|
|
133 |
frames = (
|
134 |
torch.from_numpy(frames).permute(0, 3, 1, 2).to(opts.device) * 2.0 - 1.0
|
135 |
) # 49 576 1024 3 -> 49 3 576 1024, [-1,1]
|
|
|
130 |
window_size=opts.window_size,
|
131 |
overlap=opts.overlap,
|
132 |
).to(opts.device)
|
133 |
+
|
134 |
frames = (
|
135 |
torch.from_numpy(frames).permute(0, 3, 1, 2).to(opts.device) * 2.0 - 1.0
|
136 |
) # 49 576 1024 3 -> 49 3 576 1024, [-1,1]
|