Package: cvu-python
CVU: Computer Vision UtilsComputer 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, CVUcan help! Designed to be used by both the expert and the novice, CVUaims at making CV pipelines easier to build and consistent around platforms, devices and models.Code Examplepipinstallcvu-pythonCVUlets 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 CVUcomponents, 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. CVUcan 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, CVUonly provides Object Detection, but we are in the process to support Segmentation, Background removal, Tracking, and Image text matching out of the box.Index 📋Getting StartedWhy CVU?Object Detection (YOLOv5)TensorRTTorchONNXTensorFlowTFLiteDevices (CPU, GPU, TPU)Benchmark-Tool (YOLOv5)Benchmarks Results (YOLOv5)Precission Accuracy (YOLOv5)ExamplesReferencesCVUSays Hi!IndexHow 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!fromvidsz.opencvimportReader,Writerfromcvu.detectorimportDetector# set video reader and writer, you can also use normal OpenCVreader=Reader("example.mp4")writer=Writer(reader,name="output.mp4")# create detector with tensorrt backend having fp16 precision by defaultdetector=Detector(classes="coco",backend="tensorrt")# process framesforframeinreader:# make predictions.preds=detector(frame)# draw it on framepreds.draw(frame)# write it to outputwriter.write(frame)writer.release()reader.release()Want to use less lines of code? How about this!fromcvu.detectorimportDetectorfromvidsz.opencvimportReader,Writerdetector=Detector(classes="coco",backend="tensorrt")withReader("example.mp4")asreader:withWriter(reader,name="output.mp4")aswriter:writer.write_all(map(lambdaframe:detector(frame).draw(frame),reader))Want to switch to non-cuda device? Just setdevice="cpu", and backend to"onnx","tflite","torch"or"tensorflow".detector=Detector(classes="coco",backend="onnx",device="cpu")Want to use TPU? Just setdevice="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.DevicesIndexSupport InfoFollowing is latest support matrixDeviceTensorFlowTorchTFLiteONNXTensorRTGPU✅✅❌✅✅CPU✅✅✅✅❌TPU✅❌❌❌❌Recommended Backends (in order)Based on FPS performance and various benchmarksGPU:TensorRT>Torch>ONNX>TensorFlowCPU:ONNX>TFLite>TensorFlow>TorchTPU:TensorFlowReferencesLogo-AttributionDesigned by roserodionova / FreepikYolov5 (Default Object Detection Model)