cccv
an inference lib for image/video restoration and video frame interpolation with VapourSynth support
Install
Make sure you have Python >= 3.9 and PyTorch >= 2.0 installed
pip install cccv
- Install VapourSynth (optional)
Start
Load a registered model in cccv
a simple example to use the SISR (Single Image Super-Resolution) model to process an image
import cv2
import numpy as np
from cccv import AutoModel, ConfigType, SRBaseModel
model: SRBaseModel = AutoModel.from_pretrained(ConfigType.RealESRGAN_AnimeJaNai_HD_V3_Compact_2x)
img = cv2.imdecode(np.fromfile("test.jpg", dtype=np.uint8), cv2.IMREAD_COLOR)
img = model.inference_image(img)
cv2.imwrite("test_out.jpg", img)
Load a custom model from remote repository or local path
a simple example to use remote repository or local path, auto register the model then load
import cv2
import numpy as np
from cccv import AutoModel, SRBaseModel
# remote repo
model: SRBaseModel = AutoModel.from_pretrained("https://github.com/EutropicAI/cccv_demo_remote_model")
# local path
model: SRBaseModel = AutoModel.from_pretrained("/path/to/cccv_demo_model")
VapourSynth
a simple example to use the VapourSynth to process a video
import vapoursynth as vs
from vapoursynth import core
from cccv import AutoModel, ConfigType, SRBaseModel
model: SRBaseModel = AutoModel.from_pretrained(
ConfigType.RealESRGAN_AnimeJaNai_HD_V3_Compact_2x,
tile=None
)
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)
clip = core.resize.Bicubic(clip=clip, matrix_s="709", format=vs.YUV420P16)
clip.set_output()
See more examples in the example directory, including:
- SISR (Single Image Super-Resolution)
- VSR (Video Super-Resolution)
- VFI (Video Frame Interpolation)
cccv can register custom configurations and models to extend the functionality
Current Support
It still in development, the following models are supported:
Notice
-
All the architectures have been edited to normalize input and output, and automatic padding is applied. The input and output tensor shapes may differ from the original architectures. For SR models, the input and output are both 4D tensors in the shape of
(b, c, h, w). For VSR models, the input and output are both 5D tensors in the shape of(b, l, c, h, w). -
For VSR models with equal l in input and output
(f1, f2, f3, f4 -> f1', f2', f3', f4'), you can directly extend fromclass VSRBaseModel. For VSR models that output only one frame(f-2, f-1, f0, f1, f2 -> f0'), you also need to setself.one_frame_out = True.
Reference
License
This project is licensed under the MIT - see the LICENSE file for details.
Metadata
Release files for cccv 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cccv-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / cccv-0.1.0-py3-none-any.whl
| Download URL | cccv-0.1.0-py3-none-any.whl |
|---|---|
| Size | 109.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cdb272d2e5e7655e60f345587e4b640c2b00753c6064385e482beaf1bb5e7ce
|
|
BLAKE2b-256 checksum How to use checksums |
c71ac4c41eb26ccf4ac20849440597aff50568fc64fa95a4b807af010e4df763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log