n00mkrad / flowframes

Flowframes Windows GUI for video interpolation using DAIN (NCNN) or RIFE (CUDA/NCNN)
GNU General Public License v3.0
1.46k stars 114 forks source link

Flowframes Interpolation issue. Interpolated frames are interpolated out of sequence #227

Open srosenow98 opened 1 year ago

srosenow98 commented 1 year ago

Hi, all. (crossposted from discussions, perhaps this was the better place to post? Sorry for the confusion)

A while back, I had some great success after being suggested I use Flowframes for a personal project of mine involving a famous sequence of photos taken by Gary Rosenquist, of the Mount St. Helens eruption in 1980. This project involved the use of AI-enhanced documentary screenshots of that sequence. (A link to that is here: https://www.youtube.com/watch?v=UNlP9TGZOMI )

The quality of those AI-enhanced screenshots, while great for the purpose of a basic illustration, did not match the original resolution of the photos Rosenquist took. At the time, I did not have them, and that was two months ago.

Since then, through several sources (mostly old, archived USGS reports and a few books), I've been able to source the original resolution copies of Rosenquist's famous sequence, and as a result, I'm attempting a full-HD scale interpolation in the way I did the last one.

When I attempt this process, the frames are subsequently mis-ordered and interpolated out of sequence. Attached is a screenshot of the raw source folder from which I am working (disregard the last frame, it's a hypothetical frame based on a photo by another observer named Keith Ronnholm, who was at the same location, taken after Rosenquist ran out of film). Each frame is ordered 1-22.

Subsequently, I've attached a screenshot showing the output interpolation folder. Notice both the out-of-order interpolation at which the frames are created, and the garbled appearance of some of the interpolated frames. I did not experience this when performing the earlier interpolation and in fact the earlier interpolation went off without a hitch. Now that I am working with higher-resolution source material, it seems as though the interpolation is flawed. Is this because of the higher-resolution source material?

More importantly, how do I fix it?

image

image

Emsung commented 1 year ago

I've got the same issue.

Fresh install of Flowframes 1.40.0 `[00001114] [04-04-2023 21:34:43]: Failed to parse "Normal Speed" to int: De indeling van de invoertekenreeks is onjuist. [00001115] [04-04-2023 21:34:43]: RefreshExtensions(Both) - alpha = False pngOutput = False aviHqChroma = False proresHqChroma = False [00001116] [04-04-2023 21:34:43]: RefreshExtensions - Using '.jpg' for imported frames, using '.png' for interpolated frames

[00001119] [04-04-2023 21:34:43]: RefreshAlpha: model.supportsAlpha = False - outputSupportsAlpha = False - input ext: .png => alpha = False [00001120] [04-04-2023 21:34:43]: RefreshExtensions(Import) - alpha = False pngOutput = False aviHqChroma = False proresHqChroma = False [00001121] [04-04-2023 21:34:43]: RefreshExtensions - Using '.jpg' for imported frames, using '.png' for interpolated frames [00001122] [04-04-2023 21:34:43]: Getting media resolution (E:\stable-diffusion-webui\outputs\img2img-images\loopback-wave\4110793041) [00001123] [04-04-2023 21:34:43]: Cache contains this hash, using cached value. [00001124] [04-04-2023 21:34:43]: Un-rounded downscaled size: 512x768 [00001125] [04-04-2023 21:34:43]: Sequence compatible! [00001126] [04-04-2023 21:34:43]: [UI] Loading images from 4110793041... [00001127] [04-04-2023 21:34:43]: Symlink Import disabled, copying input frames... [00001128] [04-04-2023 21:34:44]: Processing frames... [00001129] [04-04-2023 21:34:44]: Downloading models... [00001130] [04-04-2023 21:34:44]: DownloadModelFiles(string ai = RIFE_NCNN_VS, string model = rife-v4.4, bool log = True) [00001131] [04-04-2023 21:34:44]: Computed CRC32 for 'flownet.bin' (9.8 MB): 2931561690 (11ms) [00001132] [04-04-2023 21:34:44]: Computed CRC32 for 'flownet.param' (13.6 KB): 2236004978 (0ms) [00001133] [04-04-2023 21:34:44]: Not Using AutoEnc: Using piped encoding. [00001134] [04-04-2023 21:34:44]: Getting media resolution (E:\stable-diffusion-webui\outputs\img2img-images\loopback-wave\4110793041) [00001135] [04-04-2023 21:34:44]: Cache contains this hash, using cached value. [00001136] [04-04-2023 21:34:44]: Un-rounded downscaled size: 512x768 [00001137] [04-04-2023 21:34:44]: [UI] Running RIFE (NCNN-VS)... [00001138] [04-04-2023 21:34:44]: Un-rounded downscaled size: 512x768 [00001139] [04-04-2023 21:34:44]: Un-rounded downscaled size: 512x768 [00001140] [04-04-2023 21:34:44]: Converted float 0 to Fraction 0/1 [00001145] [04-04-2023 21:34:44]: Converted float 1 to Fraction 1/1 [00001146] [04-04-2023 21:34:44]: Converted float 0 to Fraction 0/1 [00001147] [04-04-2023 21:34:44]: Getting media resolution (E:\stable-diffusion-webui\outputs\img2img-images\loopback-wave\4110793041) [00001148] [04-04-2023 21:34:44]: Cache contains this hash, using cached value. [00001149] [04-04-2023 21:34:44]: Un-rounded downscaled size: 512x768 [00001150] [04-04-2023 21:34:44]: Running AI... [00001151] [04-04-2023 21:34:45]: NCNN: Found GPU 0 with compute queue count 8 [00001153] [04-04-2023 21:34:45]: Starting GetProgressFromFfmpegLog() loop for log 'rife-ncnn-vs-log', target is 421 frames [00001154] [04-04-2023 21:34:45]: [UI] Interpolated 0/421 Frames (0%) - Average Speed: 0.00 FPS In / 0.00 FPS Out - Time: 05s - ETA: 08s [00001155] [04-04-2023 21:34:45]: Creating RIFE VS script. Model: rife-v4.4, Factor: 2, Res: 512x768, UHD: False, SC Sens: 0, GPU ID: 0, GPU Threads: 4, TTA: False, Loop: False, Match Duration: False, Dedupe: False, RT: False [00001156] [04-04-2023 21:34:45]: Un-rounded downscaled size: 512x768 [00001157] [04-04-2023 21:34:45]: Un-rounded downscaled size: 512x768 [00001158] [04-04-2023 21:34:45]: cmd.exe /C cd /D "E:\Flowframes\FlowframesData\pkgs\rife-ncnn-vs" & vspipe "E:\Flowframes\FlowframesData\pkgs\rife-ncnn-vs\rife.vpy" -c y4m - | "E:\Flowframes\FlowframesData\pkgs\av\ffmpeg" -y -r 60/1 -i pipe: -filter_complex [0:v]pad=width=ceil(iw/2)2:height=ceil(ih/2)2:color=black@0[vf] -map [vf] -movflags +faststart -c:v libx264 -g 600 -pix_fmt yuv420p -crf 16 -preset fast "E:\stable-diffusion-webui\outputs\img2img-images\loopback-wave\4110793041-2x-RIFE-RIFE4.4-60fps.mp4" [00001193] [04-04-2023 21:34:48]: [UI] [REPL] Interpolated 11/421 Frames (3%) - Average Speed: 3.30 FPS In / 6.60 FPS Out - Time: 02s - ETA: 01:02 [00001195] [04-04-2023 21:34:48]: [UI] [REPL] Interpolated 79/421 Frames (19%) - Average Speed: 18.13 FPS In / 36.26 FPS Out - Time: 03s - ETA: 09s [00001197] [04-04-2023 21:34:48]: Disk space check for 'E:/': 67.9 GB free. [00001198] [04-04-2023 21:34:49]: [UI] [REPL] Interpolated 147/421 Frames (35%) - Average Speed: 27.32 FPS In / 54.65 FPS Out - Time: 03s - ETA: 05s [00001200] [04-04-2023 21:34:49]: [UI] [REPL] Interpolated 215/421 Frames (51%) - Average Speed: 33.55 FPS In / 67.10 FPS Out - Time: 04s - ETA: 03s [00001202] [04-04-2023 21:34:50]: [UI] [REPL] Interpolated 281/421 Frames (67%) - Average Speed: 37.82 FPS In / 75.64 FPS Out - Time: 04s - ETA: 02s [00001226] [04-04-2023 21:34:50]: [UI] Done running RIFE - Interpolation took 05s. Peak Output FPS: 75.64 [00001227] [04-04-2023 21:34:50]: Muxing audio/subtitles into video... [00001228] [04-04-2023 21:34:50]: Skipping muxing from input step as there is no input video, only frames. [00001229] [04-04-2023 21:34:50]: [UI] Deleting temporary files...

[00001231] [04-04-2023 21:34:50]: [UI] Total processing time: 07s [00001232] [04-04-2023 21:34:50]: Done interpolating!

tinkertims commented 1 year ago

Rename your 1-9 input files to match the format 001.jpg, 002.jpg...009.jpg. You can leave the rest as is. Otherwise the software orders them 1.jpg, 10.jpg...19.jpg, 3.jpg, 20.jpg...29.jpg, 3.jpg, 30.jpg and so on. So adding the leading "0"s to the single digit files fixes this.