{"id":21757737,"url":"https://github.com/bluemirrors/cvu","last_synced_at":"2025-05-08T21:16:45.914Z","repository":{"id":38076081,"uuid":"367533664","full_name":"BlueMirrors/cvu","owner":"BlueMirrors","description":"Computer Vision deployment tools for dummies and experts. CVU  aims at making CV pipelines easier to build and consistent around platforms, devices, and models.","archived":false,"fork":false,"pushed_at":"2023-08-20T06:38:15.000Z","size":40938,"stargazers_count":88,"open_issues_count":3,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T21:16:40.359Z","etag":null,"topics":["computer-vision","object-detection","onnxruntime","pytorch","tensorflow2","tensorrt","yolov5"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/cvu-python/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueMirrors.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-15T03:49:05.000Z","updated_at":"2024-08-30T06:18:45.000Z","dependencies_parsed_at":"2023-10-20T18:29:28.579Z","dependency_job_id":null,"html_url":"https://github.com/BlueMirrors/cvu","commit_stats":{"total_commits":249,"total_committers":13,"mean_commits":"19.153846153846153","dds":0.3092369477911646,"last_synced_commit":"5b32a233271042dd06b6a99b9e40e5ef2ca8bfc9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fcvu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fcvu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fcvu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fcvu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueMirrors","download_url":"https://codeload.github.com/BlueMirrors/cvu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149621,"owners_count":21861740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","object-detection","onnxruntime","pytorch","tensorflow2","tensorrt","yolov5"],"created_at":"2024-11-26T11:16:53.946Z","updated_at":"2025-05-08T21:16:45.895Z","avatar_url":"https://github.com/BlueMirrors.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CVU: Computer Vision Utils \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"30\"\u003e \n\n[![CodeFactor](https://www.codefactor.io/repository/github/bluemirrors/cvu/badge?s=700eb6a402321377322a7f4c15ebf99055e0c299)](https://www.codefactor.io/repository/github/bluemirrors/cvu) [![stability-alpha](https://img.shields.io/badge/stability-alpha-f4d03f.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#alpha)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) [![Downloads](https://pepy.tech/badge/cvu-python)](https://pepy.tech/project/cvu-python) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1FvebFw40Bm0bUHWCgS0-iuYp8AKLIfSh?usp=sharing)\n\n\n\u003cbr\u003e\n\nComputer Vision pipeline framework with SOTA components for dummies and experts.\u003cbr\u003e\u003cbr\u003e\nWhether you are developing an end-to-end computer vision pipeline or just looking to use some quick computer vision in your project, CVU \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e can help! Designed to be used by both the expert and the novice, CVU \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e aims at making CV pipelines easier to build and consistent around platforms, devices and models.\u003cbr\u003e\u003cbr\u003e\n\n\nCode Example \u003ca href=\"https://youtu.be/MFXC8xVt2fg\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge\u0026logo=youtube\u0026logoColor=white\" height=\"15\"\u003e\u003c/a\u003e\n```bash\npip install cvu-python\n```\n\n\u003cbr\u003e\u003cbr\u003e\nCVU \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e 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 \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e 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.) \n\n\nIt 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 \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e 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. \n\nCurrently, CVU \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e only provides Object Detection, but we are in the process to support Segmentation, Background removal, Tracking, and Image text matching out of the box.  \n\n# Index 📋\n\n- [Getting Started](#cvu--says-hi) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1FvebFw40Bm0bUHWCgS0-iuYp8AKLIfSh?usp=sharing)\n- [Why CVU?](https://github.com/BlueMirrors/cvu/wiki)\n- [Object Detection (YOLOv5)](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-object-detection) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1FvebFw40Bm0bUHWCgS0-iuYp8AKLIfSh?usp=sharing)\n  - [TensorRT](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-TensorRT)\n  - [Torch](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-Torch)\n  - [ONNX](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-ONNX)\n  - [TensorFlow](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-TensorFlow)\n  - [TFLite](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-TFLite)\n- [Devices (CPU, GPU, TPU)](#devices)\n- [Benchmark-Tool (YOLOv5)](https://github.com/BlueMirrors/cvu/wiki/Benchmark-tool)\n- [Benchmarks Results (YOLOv5)](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-benchmarking)\n- [Precission Accuracy (YOLOv5)](https://github.com/BlueMirrors/cvu/wiki/YOLOv5-object-detection#precission-accuracy-yolov5)\n- [Examples](https://github.com/BlueMirrors/cvu/tree/master/examples)\n- [References](#references)\n\n\u003cbr\u003e\n\n# CVU \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"25\"\u003e Says Hi!\n\n[Index](#index-)\n\n\nHow 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?\u003cbr\u003e\u003cbr\u003e\n\nWith CVU \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/cvu/master/static/logo.png\" width=\"12\"\u003e, 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!\u003cbr\u003e\n\n```python\nfrom vidsz.opencv import Reader, Writer\nfrom cvu.detector import Detector\n\n# set video reader and writer, you can also use normal OpenCV\nreader = Reader(\"example.mp4\")\nwriter = Writer(reader, name=\"output.mp4\")\n\n\n# create detector with tensorrt backend having fp16 precision by default\ndetector = Detector(classes=\"coco\", backend=\"tensorrt\")\n\n# process frames\nfor frame in reader:\n\n    # make predictions.\n    preds = detector(frame)\n\n    # draw it on frame\n    preds.draw(frame)\n\n    # write it to output\n    writer.write(frame)\n\nwriter.release()\nreader.release()\n\n```\n\n\u003cbr\u003e\n\nWant to use less lines of code? How about this! \u003cbr\u003e\n\n```python\nfrom cvu.detector import Detector\nfrom vidsz.opencv import Reader, Writer\n\ndetector = Detector(classes=\"coco\", backend=\"tensorrt\")\n\n\nwith Reader(\"example.mp4\") as reader:\n    with Writer(reader, name=\"output.mp4\") as writer:\n        writer.write_all(map(lambda frame:detector(frame).draw(frame), reader))\n```\n\n\u003cbr\u003e\n\nWant to switch to non-cuda device? Just set `device=\"cpu\"`, and backend to `\"onnx\"`, `\"tflite\"`, `\"torch\"` or `\"tensorflow\"`.\n\n\u003cbr\u003e\n\n```python\ndetector = Detector(classes=\"coco\", backend=\"onnx\", device=\"cpu\")\n```\n\n\u003cbr\u003e\n\nWant to use TPU? Just set `device=\"tpu\"` and choose a supported backend (only `\"tensorflow\"` supported as of the latest release)\n\n\u003cbr\u003e\n\n```python\ndetector = Detector(classes=\"coco\", backend=\"tensorflow\", device=\"tpu\")\n```\n\nYou can change devices, platforms and backends as much as you want, without having to change your pipeline.\n\n\u003cbr\u003e\n\n# Devices\n\n[Index](#index-)\n\n### Support Info\n\nFollowing is latest support matrix\n\n| Device | TensorFlow | Torch | TFLite | ONNX | TensorRT |\n| ------ | ---------- | ----- | ------ | ---- | -------- |\n| GPU    | ✅         | ✅    | ❌     | ✅   | ✅       |\n| CPU    | ✅         | ✅    | ✅     | ✅   | ❌       |\n| TPU    | ✅         | ❌    | ❌     | ❌   | ❌       |\n\n\u003cbr\u003e\n\n### Recommended Backends (in order)\n\nBased on FPS performance and various benchmarks\n\n- GPU: `TensorRT` \u003e `Torch` \u003e `ONNX` \u003e `TensorFlow`\n- CPU: `ONNX` \u003e `TFLite` \u003e `TensorFlow` \u003e `Torch`\n- TPU: `TensorFlow`\n\n\u003cbr\u003e\u003cbr\u003e\n\n# References\n\n- **_Logo-Attribution_**\n  \u003ca href=\"http://www.freepik.com\"\u003eDesigned by roserodionova / Freepik\u003c/a\u003e\n- [Yolov5 (Default Object Detection Model)](https://github.com/ultralytics/yolov5)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluemirrors%2Fcvu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluemirrors%2Fcvu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluemirrors%2Fcvu/lists"}