Spaces:
Runtime error
Runtime error
Commit
·
53a26cd
1
Parent(s):
b8becf0
options/Video_model/__pycache__/Model.cpython-310.pyc
CHANGED
|
Binary files a/options/Video_model/__pycache__/Model.cpython-310.pyc and b/options/Video_model/__pycache__/Model.cpython-310.pyc differ
|
|
|
options/Video_model/utils.py
CHANGED
|
@@ -29,9 +29,14 @@ def load_lora_weights(unet, pretrained_model_name_or_path_or_dict: Union[str, Di
|
|
| 29 |
adapter_name=adapter_name,
|
| 30 |
)
|
| 31 |
|
|
|
|
| 32 |
def save_video(frames, save_path, fps, quality=9):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
writer = imageio.get_writer(save_path, fps=fps, quality=quality)
|
| 34 |
for frame in frames:
|
| 35 |
frame = np.array(frame)
|
| 36 |
writer.append_data(frame)
|
| 37 |
-
writer.close()
|
|
|
|
| 29 |
adapter_name=adapter_name,
|
| 30 |
)
|
| 31 |
|
| 32 |
+
|
| 33 |
def save_video(frames, save_path, fps, quality=9):
|
| 34 |
+
# Ensure the file is saved with a video format
|
| 35 |
+
if not save_path.endswith(('.mp4', '.avi', '.gif')):
|
| 36 |
+
save_path += '.mp4' # Default to mp4 if no valid extension is provided
|
| 37 |
+
|
| 38 |
writer = imageio.get_writer(save_path, fps=fps, quality=quality)
|
| 39 |
for frame in frames:
|
| 40 |
frame = np.array(frame)
|
| 41 |
writer.append_data(frame)
|
| 42 |
+
writer.close()
|