Skip to main content

an inference lib for video frame interpolation with VapourSynth support

Project description

ccvfi

codecov CI-test Release-pypi PyPI version GitHub

an inference lib for video frame interpolation with VapourSynth support

Install

Make sure you have Python >= 3.9 and PyTorch >= 1.13 installed

pip install ccvfi
  • Install VapourSynth (optional)

Start

cv2

a simple example to use the RIFE (ECCV2022-RIFE) model to process an image sequence.

import cv2
import numpy as np

from ccvfi import AutoModel, ConfigType, VFIBaseModel

model: VFIBaseModel = AutoModel.from_pretrained(
    pretrained_model_name=ConfigType.RIFE_IFNet_v426_heavy,
)

img0 = cv2.imdecode(np.fromfile("01.jpg", dtype=np.uint8), cv2.IMREAD_COLOR)
img1 = cv2.imdecode(np.fromfile("02.jpg", dtype=np.uint8), cv2.IMREAD_COLOR)
out = model.inference_image_list(img_list=[img0, img1])[0]
cv2.imwrite("test_out.jpg", out)

VapourSynth

a simple example to use the VFI (Video Frame-Interpolation) model to process a video (DRBA)

import vapoursynth as vs
from vapoursynth import core

from ccvfi import AutoModel, BaseModelInterface, ConfigType

model: BaseModelInterface = AutoModel.from_pretrained(
    pretrained_model_name=ConfigType.DRBA_IFNet,
)

clip = core.bs.VideoSource(source="s.mp4")
clip = core.resize.Bicubic(clip=clip, matrix_in_s="709", format=vs.RGBH)
clip = model.inference_video(clip, tar_fps=60)
clip = core.resize.Bicubic(clip=clip, matrix_s="709", format=vs.YUV420P16)
clip.set_output()

See more examples in the example directory, ccvfi can register custom configurations and models to extend the functionality

Current Support

It still in development, the following models are supported:

Reference

License

This project is licensed under the MIT - see the LICENSE file for details.

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 Distribution

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

ccvfi-0.0.3-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file ccvfi-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ccvfi-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ccvfi-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 011289c3e4581e5ac1bf4d791fcd9e5bc135fc9d788f3fefed4340eade7b2ab0
MD5 528e5c20899b9976741cf7adcd1b3a01
BLAKE2b-256 be8eeff8c91633977c325f741a169cbac45af8913c1cc286b0da51581e9cf581

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