Skip to main content

CVU: Computer Vision Utils

CodeFactor stability-alpha made-with-python Downloads Open In Colab


Computer Vision pipeline framework with SOTA components for dummies and experts.

Whether you are developing an end-to-end computer vision pipeline or just looking to use some quick computer vision in your project, CVU can help! Designed to be used by both the expert and the novice, CVU aims at making CV pipelines easier to build and consistent around platforms, devices and models.

Code Example

pip install cvu-python



CVU lets you create end-to-end pipelines with various SOTA/customizable components. With a focus on a common component interface, you naturally create a loosely coupled pipeline with most of the implementation details hidden. Because of this, you can combine any number of CVU components, in any order, to create a pipeline of your need. You can set and switch between one or multiple pipeline input sources (eg. an image, folder, video, or live stream) and output sinks (eg. video file, image with results drawn, TXT/JSON dumps, etc.)

It also comes with optional + customizable default settings which can run a benchmark on your platform/machine to optimally choose dependencies based on accuracy and latency preferences. CVU can also automatically switch/select target devices (CPU, GPU, TPU), computation backends (TF, PyTorch, ONNX, TensorRT, TFLite), and models (small, big, etc.) based on where the pipeline is running.

Currently, CVU only provides Object Detection, but we are in the process to support Segmentation, Background removal, Tracking, and Image text matching out of the box.

Index 📋


CVU Says Hi!

Index

How many installation-steps and lines of code will you need to run object detection on a video with a TensorRT backend? How complicated is it be to test that pipeline in Colab?

With CVU , you just need the following! No extra installation steps needed to run on Colab, just pip install our tool, and you're all set to go!

from vidsz.opencv import Reader, Writer
from cvu.detector import Detector

# set video reader and writer, you can also use normal OpenCV
reader = Reader("example.mp4")
writer = Writer(reader, name="output.mp4")


# create detector with tensorrt backend having fp16 precision by default
detector = Detector(classes="coco", backend="tensorrt")

# process frames
for frame in reader:

    # make predictions.
    preds = detector(frame)

    # draw it on frame
    preds.draw(frame)

    # write it to output
    writer.write(frame)

writer.release()
reader.release()

Want to use less lines of code? How about this!

from cvu.detector import Detector
from vidsz.opencv import Reader, Writer

detector = Detector(classes="coco", backend="tensorrt")


with Reader("example.mp4") as reader:
    with Writer(reader, name="output.mp4") as writer:
        writer.write_all(map(lambda frame:detector(frame).draw(frame), reader))

Want to switch to non-cuda device? Just set device="cpu", and backend to "onnx", "tflite", "torch" or "tensorflow".


detector = Detector(classes="coco", backend="onnx", device="cpu")

Want to use TPU? Just set device="tpu" and choose a supported backend (only "tensorflow" supported as of the latest release)


detector = Detector(classes="coco", backend="tensorflow", device="tpu")

You can change devices, platforms and backends as much as you want, without having to change your pipeline.


Devices

Index

Support Info

Following is latest support matrix

Device TensorFlow Torch TFLite ONNX TensorRT
GPU ✅ ✅ ❌ ✅ ✅
CPU ✅ ✅ ✅ ✅ ❌
TPU ✅ ❌ ❌ ❌ ❌

Recommended Backends (in order)

Based on FPS performance and various benchmarks

  • GPU: TensorRT > Torch > ONNX > TensorFlow
  • CPU: ONNX > TFLite > TensorFlow > Torch
  • TPU: TensorFlow



References

Metadata

Release files for cvu-python 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvu-python 0.0.2
File Size Uploaded Provenance Actions
cvu-python-0.0.2.tar.gz 39.5 kB Without provenance Details for cvu-python-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cvu-python 0.0.2
File Interpreter ABI Platform Actions
cvu_python-0.0.2-py3-none-any.whl Python 3 none any Details for cvu_python-0.0.2-py3-none-any.whl

Total release size: 97.6 kB

Release files / cvu-python-0.0.2.tar.gz

Download URL cvu-python-0.0.2.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e0341c0f16d9d90088ac2eb069889b48190ad4b6aaf28206630c7e8f8511c6f9
BLAKE2b-256 checksum
How to use checksums
b4c25e40e4258e14ff7e88b0982e1b66cc11b25babe30b399bbdd84d177f765f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / cvu_python-0.0.2-py3-none-any.whl

Download URL cvu_python-0.0.2-py3-none-any.whl
Size 58.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b0be84537d25bc65d9bf10ba55939a24c8b9fe71ab21f8fdb0109faeafb108d
BLAKE2b-256 checksum
How to use checksums
31d80a26dd8ddfc05b82105af52000cb20dbf34c410a40f4c893489bdcc31143
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for cvu-python 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page