Giter VIP home page Giter VIP logo

rife-ncnn-vulkan-python's Introduction

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

rife-ncnn-vulkan-python's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rife-ncnn-vulkan-python's Issues

Error when trying to pip install

Hi,

Continuing with our discussion in nihui/rife-ncnn-vulkan#72

Here's the output for pip install:

output.txt

I will also try manually building, I just figured that I was using VS 2022 so that could've been an issue so I have downgraded to 2019 and I have yet to see if that will yield in any success.

macOS 11.5.2 Symbol not found: _NSLocalizedDescriptionKey

Hello and thank you for this nice port to python !

when i try to execute rife_ncnn_vulkan.py ( with pics added to ../images folder ) .. latest release download https://github.com/media2x/rife-ncnn-vulkan-python/releases/tag/20210520
I get the following error.

Traceback (most recent call last):
  File "/Users/drquader/Desktop/RIFE_python/rife-ncnn-vulkan-python-20210504-macos/rife_ncnn_vulkan.py", line 12, in <module>
    import rife_ncnn_vulkan_wrapper as raw
  File "/Users/drquader/Desktop/RIFE_python/rife-ncnn-vulkan-python-20210504-macos/rife_ncnn_vulkan_wrapper.py", line 15, in <module>
    import _rife_ncnn_vulkan_wrapper
ImportError: dlopen(/Users/drquader/Desktop/RIFE_python/rife-ncnn-vulkan-python-20210504-macos/_rife_ncnn_vulkan_wrapper.so, 2): Symbol not found: _NSLocalizedDescriptionKey
  Referenced from: /Users/drquader/Desktop/RIFE_python/rife-ncnn-vulkan-python-20210504-macos/_rife_ncnn_vulkan_wrapper.so
  Expected in: flat namespace
 in /Users/drquader/Desktop/RIFE_python/rife-ncnn-vulkan-python-20210504-macos/_rife_ncnn_vulkan_wrapper.so

this usually means it is not linked against Foundation Framework. Any idea ?

Thanks alot !

google colab errors and libvulkan.so.1 not found??

i have this file libvulkan.so.1 in /content/libvulkan.so.1
is there download link for this file libvulkan.so.1

i even copy /usr/local/lib/python3.10/dist-packages/rife_ncnn_vulkan_python/
still nothing

where do i put this file, there is not single result on google for this

error

ImportError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/rife_ncnn_vulkan_python/rife_ncnn_vulkan_wrapper.py in swig_import_helper()
13 try:
---> 14 return importlib.import_module(mname)
15 except ImportError:

14 frames
ImportError: libvulkan.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last)
/usr/lib/python3.10/importlib/init.py in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
127
128

ModuleNotFoundError: No module named '_rife_ncnn_vulkan_wrapper'


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

ImportError: DLL load failed while importing _rife_ncnn_vulkan_wrapper: The specified module could not be found.

when you try to import the module: "from rife_ncnn_vulkan import RIFE"
the following error will come:
Traceback (most recent call last):
File ".\run_test.py", line 1, in
from rife_ncnn_vulkan import RIFE
File "C:\Users%username%\Projects\Restoration_GUI\rife\rife_ncnn_vulkan.py", line 12, in
import rife_ncnn_vulkan_wrapper as raw
File "C:\Users%username%\Projects\Restoration_GUI\rife\rife_ncnn_vulkan_wrapper.py", line 15, in
import _rife_ncnn_vulkan_wrapper
ImportError: DLL load failed while importing _rife_ncnn_vulkan_wrapper: The specified module could not be found.

I download the following file:
When downloading rife-ncnn-vulkan-python-20210504-windows.zip

This is also the case for previous builds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.