Created
February 12, 2026 22:23
-
-
Save SqrtRyan/3965fcfaff540498caaa67d43780038f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def video_path_to_strips(video_path): | |
| video = load_video(video_path, use_cache=True) | |
| indices = video[:, 0, 0, 0] > 128 | |
| indices = np.argwhere(indices) | |
| indices = indices[:, 0] | |
| frames = video[indices] | |
| from rp.git.Figures.film_strip import film_strip | |
| befores, afters = split_tensor_into_regions(frames, 1, 1, 2) | |
| strips = [film_strip(befores), film_strip(afters)] | |
| strips = [crop_image_zeros(x) for x in strips] | |
| strips = bordered_images_solid_color( | |
| strips, thickness=10, color="transparent white" | |
| ) | |
| strips = labeled_images( | |
| strips, | |
| ["Input Keyframes", "Output Video"], | |
| font="Futura", | |
| background_color="transparent white", | |
| text_color="black", | |
| position="left", | |
| size=40, | |
| ) | |
| strips = vertically_concatenated_images(strips) | |
| strips = with_drop_shadow(strips, x=5, y=5, opacity=0.5, blur=20) | |
| strips = blend_images("light light teal", strips) | |
| strips = with_corner_radius(strips, 30) | |
| display_image(strips) | |
| print("saved", save_image(strips, with_file_extension(video_path, "png"))) | |
| for path in [ | |
| "/Users/ryan/Downloads/2T95SY2 (3).mp4", | |
| "/Users/ryan/Downloads/JSV9PDP.mp4", | |
| "/Users/ryan/Downloads/5UQ985H.mp4", | |
| "/Users/ryan/Downloads/LC2QRDB (4).mp4", | |
| "/Users/ryan/Downloads/K7UNWBH (4).mp4", | |
| ]: | |
| video_path_to_strips(path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment