styler00dollar / VapourSynth-RIFE-ncnn-Vulkan

RIFE filter for VapourSynth
MIT License
97 stars 22 forks source link

Usage? #8

Closed noobtoob4lyfe closed 1 year ago

noobtoob4lyfe commented 1 year ago

Thanks for sharing this great work. I'm used to running github projects like this that use python scrips, but I'm lost with how to set this one up. Would you know of any detailed instructions or tutorials for this?

styler00dollar commented 1 year ago

Compile it with the given instructions in the readme or download the latest release here. Afterwards you can use it with this for example:

clip = core.rife.RIFE(clip, model=9, factor_num=2, gpu_id=0, gpu_thread=4, tta=False, uhd=False, skip=False, sc=False)

Certain features will require more dependencies, like skip needs vmaf and sc needs vs-miscfilters-obsolete and clip = core.misc.SCDetect(clip=clip, threshold=0.100) prior to calling rife. In my docker I compile it for linux here. If you don't know how to use vapoursynth, you should look that up since I won't explain everything from scratch. Looking at my vsgan readme and my inference script might be helpful.

styler00dollar commented 1 year ago

I guess I can close due to inactivity.

noobtoob4lyfe commented 9 months ago

Sorry for the delay. Thank you for your help! So this is not as simple as downloading the latest release, opening a shell in that directory, placing my input video in the same directory, and running the command you pasted above?

styler00dollar commented 9 months ago

No, you need to get familiar with vapoursynth scripts. Small example:

import sys
import os
import vapoursynth as vs

core = vs.core
core.num_threads = 4  # can influence ram usage
core.std.LoadPlugin(path="/home/VapourSynth-RIFE-ncnn-Vulkan/librife.so")
clip = core.ffms2.Source(source="video.mp4", cache=False)
clip = vs.core.resize.Bicubic(clip, format=vs.RGBS, matrix_in_s="709")

clip = core.rife.RIFE(
    clip,
    model=9,
    factor_num=2,
    gpu_id=0,
    gpu_thread=2,
    tta=False,
    uhd=False,
    skip=False,
    sc=False,
)

clip = vs.core.resize.Bicubic(clip, format=vs.YUV420P8, matrix_s="709")
clip.set_output()