fffiloni commited on
Commit
afad51c
·
1 Parent(s): dfce881

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -18
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
- print(f"Chunk #{index}: {chunk_path}")
125
-
126
- # Check if the file already exists
127
- if os.path.exists(os.path.join(output_path, f"{index}.mp4")):
128
- # Delete the existing file
129
- os.remove(os.path.join(output_path, f"{index}.mp4"))
130
-
131
- #if video_length > 12:
132
- # 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"
133
- #else:
134
- 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}"
135
- subprocess.run(command, shell=True)
136
-
137
- # Construct the video path
138
- video_path_output = os.path.join(output_path, f"{index}.mp4")
139
-
140
- # Append processed chunk to final array
141
- processed_chunks.append(video_path_output)
 
 
 
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