Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -121,24 +121,27 @@ def run_inference(prompt, video_path, condition, video_length):
|
|
121 |
processed_chunks = []
|
122 |
|
123 |
for index, chunk_path in enumerate(chunks):
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
142 |
|
143 |
print(f"PROCESSED CHUNKS: {processed_chunks}")
|
144 |
|
|
|
121 |
processed_chunks = []
|
122 |
|
123 |
for index, chunk_path in enumerate(chunks):
|
124 |
+
if index = 0 :
|
125 |
+
print(f"Chunk #{index}: {chunk_path}")
|
126 |
+
|
127 |
+
# Check if the file already exists
|
128 |
+
if os.path.exists(os.path.join(output_path, f"{index}.mp4")):
|
129 |
+
# Delete the existing file
|
130 |
+
os.remove(os.path.join(output_path, f"{index}.mp4"))
|
131 |
+
|
132 |
+
#if video_length > 12:
|
133 |
+
# command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{video_path}' --output_path '{output_path}' --width 512 --height 512 --fps 8 --video_length {video_length} --is_long_video"
|
134 |
+
#else:
|
135 |
+
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{chunk_path}' --output_path '{output_path}' --temp_chunk_path '{index}' --width 512 --height 512 --fps 8 --video_length {video_length}"
|
136 |
+
subprocess.run(command, shell=True)
|
137 |
+
|
138 |
+
# Construct the video path
|
139 |
+
video_path_output = os.path.join(output_path, f"{index}.mp4")
|
140 |
+
|
141 |
+
# Append processed chunk to final array
|
142 |
+
processed_chunks.append(video_path_output)
|
143 |
+
else:
|
144 |
+
print("finished")
|
145 |
|
146 |
print(f"PROCESSED CHUNKS: {processed_chunks}")
|
147 |
|