Skip to main content

A Python FFI of nihui/rife-ncnn-vulkan achieved with SWIG

Project description

RIFE ncnn Vulkan Python

CI

Introduction

rife-ncnn-vulkan is nihui's ncnn implementation of Real-Time Intermediate Flow Estimation for Video Frame Interpolation.

rife-ncnn-vulkan-python wraps rife-ncnn-vulkan project by SWIG to make it easier to integrate rife-ncnn-vulkan with existing python projects.

Downloads

Linux/Windos/Mac X86_64 binary build releases are available now.

Build

First, you have to install python, python development package (Python native development libs in Visual Studio), vulkan SDK and SWIG on your platform. And then, there are two ways to build it:

  • Install source distribution from PyPI (Currently in developing, need to download models before build.)
  • Use setuptools to build and install into python package directly.
  • Use CMake directly (The old way)

Install from PyPI

pip install rife-ncnn-vulkan-python

Use setuptools

python setup.py install

Use CMake

Linux

git clone https://github.com/ArchieMeng/rife-ncnn-vulkan-python.git
cd rife-ncnn-vulkan-python
git submodule update --init --recursive
cmake -B build src
cd build
make

Windows

I used Visual Studio 2019 and msvc v142 to build this project for Windows.

Install visual studio and open the project directory, and build. Job done.

The only problem on Windows is that, you cannot use CMake for Windows GUI to generate the Visual Studio solution file and build it. This will make the lib crash on loading.

One way is using Visual Studio to open the project as directory, and build it from Visual Studio. And another way is build it from powershell just like what is written in the release.yml

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

Example Program

from rife_ncnn_vulkan_python import Rife
from PIL import Image

with Image.open("input0.png") as image0:
    with Image.open("input1.png") as image1:
      rife = Rife(gpuid=0) # or RIFE(0) like upstream
      image = rife.process(image0, image1)
      image.save("output.png")

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

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
rife-v3.0 3.0
rife-v3.1 3.1
rife-v4 4.0
rife-v4.6 4.6

Original RIFE Project

Other Open-Source Code Used

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-win_amd64.whl (40.0 MB view details)

Uploaded CPython 3.13Windows x86-64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-macosx_14_0_arm64.whl (6.9 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-macosx_13_0_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-win_amd64.whl (40.0 MB view details)

Uploaded CPython 3.12Windows x86-64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-macosx_14_0_arm64.whl (6.9 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-macosx_13_0_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp311-cp311-win_amd64.whl (40.0 MB view details)

Uploaded CPython 3.11Windows x86-64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp310-cp310-win_amd64.whl (40.0 MB view details)

Uploaded CPython 3.10Windows x86-64

rife_ncnn_vulkan_python_tntwise-1.4.5-cp39-cp39-win_amd64.whl (40.0 MB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 71ddde8126dee857cc7935a576fcccb0f049a8abd244fae64db503ab02ed5d9d
MD5 69a38466dfb3d6a533de5bda61e8637d
BLAKE2b-256 02d22ece5571ac590237840d69594767693c4993d87f8053dbe50f6c7f765e26

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2b317c834558dcae693927c34c64c164660bb7bc10638ea7e89822f3bcb092d7
MD5 d1e22c667a9b6b26cd86bffcbcda5476
BLAKE2b-256 af9a5879380ae874f5e013bd1257a832147507c82305f4c7e99bdeeb2ac6932f

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 624435dce97bfd4a84c5aa63e8bd0d6c8cb4927c53fc85f5afe60cf003c2b45b
MD5 6af670ee6ce1aa7f62d4439d61f2fc87
BLAKE2b-256 c0a58de9b4bc9ae89a0f135bf194e7720f2e1fbcb3052a3ba09a144442795cb4

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5755ab6948d10b58961798dbf72f8bcb2b680f844e8c7fd3729544621efa1c00
MD5 a072aaac8d090919253fcef0a324bb6c
BLAKE2b-256 bcecb8afa74cc35c57490fc0a673578276418b667e3f41fb6a2626b6c30963ff

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 28d5c5cf8aabf15766284aa5b2b58b85fd62bc2029a9db18a8bc31e5c38ddadf
MD5 aa2f17a572d56cd901820ae58b39a1d9
BLAKE2b-256 a64a8d30914597b611194f0c683579c1179ac81a10b69859e007612f7aa141af

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d5765774cc668c8ae4a10c23c6fd660d7d83612e6f780f47714049d8b6e64a8c
MD5 5b7f2e63e5a5407653d306dc1765cb66
BLAKE2b-256 85197eca7cfd87be1bb265e51a4abf25b4d5acf025d5ea4a05165cf3ba15367d

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 05e33782df88fd6d0e6da16adce262bd7430ac6c30c6484981d3891f2e2fa592
MD5 65f4b163734b766633b410e18266c4ee
BLAKE2b-256 776f48653d10f3cde3da01559426ab5f68dddbc954f6d583640088edf0450e15

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 60806dc96dee7921448cb28c9fda35967a3f18923f86e5cc41050faea23e3b2f
MD5 beb3c89b9bef73a556604a8f3f9e44ce
BLAKE2b-256 935db7cfcbb0f08e07d76a083727e2b03e743e29aa078f90a8c2d026b49e1b89

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e2d1d7b547a598f4b4dd1abd0136ab57e5076b16e4c2ebf8e758da725ae9e50a
MD5 b67123a4206c6be789cb930fe4f21052
BLAKE2b-256 1c12e5e4ad5ef9330753ea867219a5b07b5e9135a9708a0f56e21448d50a8851

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9f4cc8ea35d01ec2413d1e27efd05ed74d7048867d55864d8d7ad905c02b4025
MD5 bd3792a7e738394e96d0259d909fd071
BLAKE2b-256 4a0d081f169fe2f891b6406a106d866d30c16f90ab55345c32c7d0678c90d98b

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 98d77cfd9bae317c0163a0bffe601b0f4497578793cd56b11d46e51e602569ee
MD5 d0e848d54c85e13ee3dcfd78e6732a83
BLAKE2b-256 91b02b7a8a5b5fcc90cfef52144192d75b2d40ab9797feb3056b97adc69adb2e

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a6169cf742e6d58d2a17e74671dd67cde6fdb46cd903a5d8f77400942d18481e
MD5 8a1a5996396f165539bb2eeaa4c75583
BLAKE2b-256 25b82c4e3afdda9594d729f12354eddb014575356415c6875a365f6eec7d3ecf

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b55af9c5ed8ac9414786b424dec577a3c0d59da7be7d52e502afc5fd817988ab
MD5 1fa66c4a4455ce25381650aee1e5b3d1
BLAKE2b-256 70cedd85214ac01ff68fe1590d5f0a9bf622269cce5927d39ca4e1fe808606d7

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 46e0aa3892f075e88513b2e2aac530199e5fae13a33e6852022e06bde6ba3955
MD5 5287b376bc680f67d6bb5322a5d3fafd
BLAKE2b-256 8b4fff0a1774c1463e3d14225744af21d59c4ac6fb597541d39a5c8610ff38c7

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a2a97d1d813fe8735aa1a71a8fbe4a34fab53b82336cf23795e9fc27cd41837b
MD5 0b9e414f0b3653effc25db0939e07041
BLAKE2b-256 080c6d1d17717cf3d820df17f7cf0f51aca966aacd3ea4d6108cc67f2ed1b49c

See more details on using hashes here.

File details

Details for the file rife_ncnn_vulkan_python_tntwise-1.4.5-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rife_ncnn_vulkan_python_tntwise-1.4.5-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 983ea15ea9e44479bbc0996787430a9802e491586ece5344ff9c1a482b5b118e
MD5 e2f998606631c9f0d910f7aa9e8d5dae
BLAKE2b-256 04d5cf935ac562d8d7aeff5704203b755769507b8747241f63adec2c187d6d21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page