Download image/renderer.py from cloudfom/it: direct link, hf CLI and curl.
- Browser
- Download file 344 Bytes
-
https://huggingface.co/spaces/cloudfom/it/resolve/main/image/renderer.py
- Command line
-
hf download hf://spaces/cloudfom/it/image/renderer.py
-
curl -L -o renderer.py https://huggingface.co/spaces/cloudfom/it/resolve/main/image/renderer.py
344 Bytes
| from moviepy.editor import ImageSequenceClip | |
| import os | |
| def render_video(frames_dir, output_path, fps=30): | |
| frames = sorted([ | |
| os.path.join(frames_dir, f) | |
| for f in os.listdir(frames_dir) | |
| if f.endswith(".png") | |
| ]) | |
| clip = ImageSequenceClip(frames, fps=fps) | |
| clip.write_videofile(output_path, codec="libx264") | |