All Projects → nihui → Rife Ncnn Vulkan

nihui / Rife Ncnn Vulkan

Licence: mit
RIFE, Real-Time Intermediate Flow Estimation for Video Frame Interpolation implemented with ncnn library

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Rife Ncnn Vulkan

docker-nvidia-glx-desktop
MATE Desktop container designed for Kubernetes supporting OpenGL GLX and Vulkan for NVIDIA GPUs with WebRTC and HTML5, providing an open source remote cloud graphics or game streaming platform. Spawns its own fully isolated X Server instead of using the host X server, therefore not requiring /tmp/.X11-unix host sockets or host configuration.
Stars: ✭ 47 (-56.48%)
Mutual labels:  gpu, vulkan
Gfx
[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
Stars: ✭ 5,045 (+4571.3%)
Mutual labels:  vulkan, gpu
Vuh
Vulkan compute for people
Stars: ✭ 264 (+144.44%)
Mutual labels:  vulkan, gpu
Dain Ncnn Vulkan
DAIN, Depth-Aware Video Frame Interpolation implemented with ncnn library
Stars: ✭ 194 (+79.63%)
Mutual labels:  vulkan, gpu
Vkquake
Vulkan Quake port based on QuakeSpasm
Stars: ✭ 955 (+784.26%)
Mutual labels:  vulkan, gpu
Neovide
No Nonsense Neovim Client in Rust
Stars: ✭ 5,678 (+5157.41%)
Mutual labels:  vulkan, gpu
Realsr Ncnn Vulkan
RealSR super resolution implemented with ncnn library
Stars: ✭ 357 (+230.56%)
Mutual labels:  vulkan, gpu
Agi
Android GPU Inspector
Stars: ✭ 327 (+202.78%)
Mutual labels:  vulkan, gpu
Acid
A high speed C++17 Vulkan game engine
Stars: ✭ 838 (+675.93%)
Mutual labels:  vulkan, gpu
Tvm
Open deep learning compiler stack for cpu, gpu and specialized accelerators
Stars: ✭ 7,494 (+6838.89%)
Mutual labels:  vulkan, gpu
Srmd Ncnn Vulkan
SRMD super resolution implemented with ncnn library
Stars: ✭ 186 (+72.22%)
Mutual labels:  vulkan, gpu
Dain Vulkan Gui
AI-Powered video interpolater (eg. 30fps -> 60fps) for Vulkan devices. Based on dain-ncnn-vulkan and ffmpeg
Stars: ✭ 58 (-46.3%)
Mutual labels:  vulkan, gpu
Vulkancore
Vulkan 1.0 graphics and compute API bindings for .NET Standard
Stars: ✭ 162 (+50%)
Mutual labels:  vulkan, gpu
Datoviz
⚡ High-performance GPU interactive scientific data visualization with Vulkan
Stars: ✭ 222 (+105.56%)
Mutual labels:  vulkan, gpu
Gapid
GAPID is a collection of tools that allows you to inspect, tweak and replay calls from an application to a graphics driver.
Stars: ✭ 1,975 (+1728.7%)
Mutual labels:  vulkan, gpu
Vkquake2
id Software's Quake 2 v3.21 with mission packs and Vulkan support (Windows, Linux, MacOS, FreeBSD, Raspberry Pi 4)
Stars: ✭ 543 (+402.78%)
Mutual labels:  vulkan, gpu
Ncnn Android Styletransfer
The style transfer android example
Stars: ✭ 54 (-50%)
Mutual labels:  vulkan, gpu
Waifu2x Ncnn Vulkan
waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan
Stars: ✭ 1,258 (+1064.81%)
Mutual labels:  vulkan, gpu
Practicalvulkan
Repository with code samples for "API without Secrets: The Practical Approach to Vulkan" series of articles.
Stars: ✭ 100 (-7.41%)
Mutual labels:  vulkan
Nvidia p106
NVIDIA P106 GPUs
Stars: ✭ 106 (-1.85%)
Mutual labels:  gpu

RIFE ncnn Vulkan

CI

ncnn implementation of RIFE, Real-Time Intermediate Flow Estimation for Video Frame Interpolation.

rife-ncnn-vulkan uses ncnn project as the universal neural network inference framework.

Download

Download Windows/Linux/MacOS Executable for Intel/AMD/Nvidia GPU

https://github.com/nihui/rife-ncnn-vulkan/releases

This package includes all the binaries and models required. It is portable, so no CUDA or PyTorch runtime environment is needed :)

About RIFE

RIFE (Real-Time Intermediate Flow Estimation for Video Frame Interpolation)

https://github.com/hzwer/arXiv2020-RIFE

Huang, Zhewei and Zhang, Tianyuan and Heng, Wen and Shi, Boxin and Zhou, Shuchang

https://rife-vfi.github.io

https://arxiv.org/abs/2011.06294

Usages

Input two frame images, output one interpolated frame image.

Example Commands

./rife-ncnn-vulkan -0 0.jpg -1 1.jpg -o 01.jpg
./rife-ncnn-vulkan -i input_frames/ -o output_frames/

Example below runs on CPU, Discrete GPU, and Integrated GPU all at the same time. Uses 2 threads for image decoding, 4 threads for one CPU worker, 4 threads for another CPU worker, 2 threads for discrete GPU, 1 thread for integrated GPU, and 4 threads for image encoding.

./rife-ncnn-vulkan -i input_frames/ -o output_frames/ -g -1,-1,0,1 -j 2:4,4,2,1:4

Video Interpolation with FFmpeg

mkdir input_frames
mkdir output_frames

# find the source fps and format with ffprobe, for example 24fps, AAC
ffprobe input.mp4

# extract audio
ffmpeg -i input.mp4 -vn -acodec copy audio.m4a

# decode all frames
ffmpeg -i input.mp4 input_frames/frame_%08d.png

# interpolate 2x frame count
./rife-ncnn-vulkan -i input_frames -o output_frames

# encode interpolated frames in 48fps with audio
ffmpeg -framerate 48 -i output_frames/%08d.png -i audio.m4a -c:a copy -crf 20 -c:v libx264 -pix_fmt yuv420p output.mp4

Full Usages

Usage: rife-ncnn-vulkan -0 infile -1 infile1 -o outfile [options]...
       rife-ncnn-vulkan -i indir -o outdir [options]...

  -h                   show this help
  -v                   verbose output
  -0 input0-path       input image0 path (jpg/png/webp)
  -1 input1-path       input image1 path (jpg/png/webp)
  -i input-path        input image directory (jpg/png/webp)
  -o output-path       output image path (jpg/png/webp) or directory
  -m model-path        rife model path (default=rife-HD)
  -g gpu-id            gpu device to use (-1=cpu, default=auto) can be 0,1,2 for multi-gpu
  -j load:proc:save    thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
  -x                   enable tta mode
  -u                   enable UHD mode
  -f pattern-format    output image filename pattern format (%08d.jpg/png/webp, default=ext/%08d.png)
  • input0-path, input1-path and output-path accept file path
  • input-path and output-path accept file directory
  • load:proc:save = thread count for the three stages (image decoding + rife interpolation + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.
  • pattern-format = the filename pattern and format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded

If you encounter a crash or error, try upgrading your GPU driver:

Build from Source

  1. Download and setup the Vulkan SDK from https://vulkan.lunarg.com/
  • For Linux distributions, you can either get the essential build requirements from package manager
dnf install vulkan-headers vulkan-loader-devel
apt-get install libvulkan-dev
pacman -S vulkan-headers vulkan-icd-loader
  1. Clone this project with all submodules
git clone https://github.com/nihui/rife-ncnn-vulkan.git
cd rife-ncnn-vulkan
git submodule update --init --recursive
  1. Build with CMake
  • You can pass -DUSE_STATIC_MOLTENVK=ON option to avoid linking the vulkan loader library on MacOS
mkdir build
cd build
cmake ../src
cmake --build . -j 4

TODO

  • test-time temporal augmentation aka TTA-t

Model

model upstream version
rife 1.2
rife-HD 1.5
rife-UHD 1.6
rife-anime 1.8
rife-v2 2.0
rife-v2.3 2.3
rife-v2.4 2.4

Sample Images

Original Image

origin0 origin1

Interpolate with rife rife-anime model

rife-ncnn-vulkan.exe -m models/rife-anime -0 0.png -1 1.png -o out.png

rife

Interpolate with rife rife-anime model + TTA-s

rife-ncnn-vulkan.exe -m models/rife-anime -x -0 0.png -1 1.png -o out.png

rife

Original RIFE Project

Other Open-Source Code Used

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].