Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,18 +173,14 @@ def run_inference(prompt, video_path, condition, video_length):
|
|
| 173 |
os.remove(os.path.join(output_path, f"result.mp4"))
|
| 174 |
|
| 175 |
if video_length > 12:
|
| 176 |
-
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{resized}' --output_path '{output_path}' --width 512 --height 512 --fps
|
| 177 |
else:
|
| 178 |
-
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{resized}' --output_path '{output_path}' --temp_chunk_path 'result' --width 512 --height 512 --fps
|
| 179 |
subprocess.run(command, shell=True)
|
| 180 |
|
| 181 |
# Construct the video path
|
| 182 |
video_path_output = os.path.join(output_path, f"result.mp4")
|
| 183 |
|
| 184 |
-
# Append processed chunk to final array
|
| 185 |
-
processed_chunks.append(video_path_output)
|
| 186 |
-
|
| 187 |
-
|
| 188 |
return "done", video_path_output
|
| 189 |
|
| 190 |
|
|
|
|
| 173 |
os.remove(os.path.join(output_path, f"result.mp4"))
|
| 174 |
|
| 175 |
if video_length > 12:
|
| 176 |
+
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{resized}' --output_path '{output_path}' --width 512 --height 512 --fps {target_fps} --video_length {video_length} --is_long_video"
|
| 177 |
else:
|
| 178 |
+
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{resized}' --output_path '{output_path}' --temp_chunk_path 'result' --width 512 --height 512 --fps {target_fps} --video_length {video_length}"
|
| 179 |
subprocess.run(command, shell=True)
|
| 180 |
|
| 181 |
# Construct the video path
|
| 182 |
video_path_output = os.path.join(output_path, f"result.mp4")
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
return "done", video_path_output
|
| 185 |
|
| 186 |
|