{"id":13441447,"url":"https://github.com/roboflow/supervision","last_synced_at":"2026-03-14T10:03:38.185Z","repository":{"id":65829559,"uuid":"571613891","full_name":"roboflow/supervision","owner":"roboflow","description":"We write your reusable computer vision tools. 💜","archived":false,"fork":false,"pushed_at":"2025-05-05T00:39:44.000Z","size":2186909,"stargazers_count":26558,"open_issues_count":116,"forks_count":2009,"subscribers_count":169,"default_branch":"develop","last_synced_at":"2025-05-05T14:10:47.520Z","etag":null,"topics":["classification","coco","computer-vision","deep-learning","hacktoberfest","image-processing","instance-segmentation","low-code","machine-learning","metrics","object-detection","oriented-bounding-box","pascal-voc","python","pytorch","tensorflow","tracking","video-processing","yolo"],"latest_commit_sha":null,"homepage":"https://supervision.roboflow.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roboflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-28T14:08:44.000Z","updated_at":"2025-05-05T14:08:40.000Z","dependencies_parsed_at":"2023-06-28T01:07:51.025Z","dependency_job_id":"a9306c5c-43ba-43dd-aa27-9581de763fe1","html_url":"https://github.com/roboflow/supervision","commit_stats":{"total_commits":2663,"total_committers":104,"mean_commits":25.60576923076923,"dds":0.7427713105520091,"last_synced_commit":"066099f42d58acef3c9b7fac98e655edfce47b80"},"previous_names":[],"tags_count":75,"template":false,"template_full_name":"roboflow/template-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Fsupervision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Fsupervision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Fsupervision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboflow%2Fsupervision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roboflow","download_url":"https://codeload.github.com/roboflow/supervision/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253774581,"owners_count":21962199,"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":["classification","coco","computer-vision","deep-learning","hacktoberfest","image-processing","instance-segmentation","low-code","machine-learning","metrics","object-detection","oriented-bounding-box","pascal-voc","python","pytorch","tensorflow","tracking","video-processing","yolo"],"created_at":"2024-07-31T03:01:34.022Z","updated_at":"2026-03-14T10:03:38.180Z","avatar_url":"https://github.com/roboflow.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003ca align=\"center\" href=\"\" target=\"https://supervision.roboflow.com\"\u003e\n      \u003cimg\n        width=\"100%\"\n        src=\"https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png?updatedAt=1678995927529\"\n      \u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\n\u003cbr\u003e\n\n[notebooks](https://github.com/roboflow/notebooks) | [inference](https://github.com/roboflow/inference) | [autodistill](https://github.com/autodistill/autodistill) | [maestro](https://github.com/roboflow/multimodal-maestro)\n\n\u003cbr\u003e\n\n[![version](https://badge.fury.io/py/supervision.svg)](https://badge.fury.io/py/supervision)\n[![downloads](https://img.shields.io/pypi/dm/supervision)](https://pypistats.org/packages/supervision)\n[![license](https://img.shields.io/pypi/l/supervision)](LICENSE.md)\n[![python-version](https://img.shields.io/pypi/pyversions/supervision)](https://badge.fury.io/py/supervision)\n[![codecov](https://codecov.io/gh/roboflow/supervision/graph/badge.svg?token=HMNJ5FVZ36)](https://codecov.io/gh/roboflow/supervision)\n\n[![snyk](https://snyk.io/advisor/python/supervision/badge.svg)](https://snyk.io/advisor/python/supervision)\n[![colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb)\n[![gradio](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Roboflow/Annotators)\n[![discord](https://img.shields.io/discord/1159501506232451173?logo=discord\u0026label=discord\u0026labelColor=fff\u0026color=5865f2\u0026link=https%3A%2F%2Fdiscord.gg%2FGbfgXGJ8Bk)](https://discord.gg/GbfgXGJ8Bk)\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://trendshift.io/repositories/124\"  target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/124\" alt=\"roboflow%2Fsupervision | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/\u003e\u003c/a\u003e\n  \u003c/div\u003e\n\n\u003c/div\u003e\n\n## 👋 hello\n\n**We write your reusable computer vision tools.** Whether you need to load your dataset from your hard drive, draw detections on an image or video, or count how many detections are in a zone. You can count on us! 🤝\n\n## 💻 install\n\nPip install the supervision package in a\n[**Python\u003e=3.9**](https://www.python.org/) environment.\n\n```bash\npip install supervision\n```\n\nRead more about conda, mamba, and installing from source in our [guide](https://roboflow.github.io/supervision/).\n\n## 🔥 quickstart\n\n### models\n\nSupervision was designed to be model agnostic. Just plug in any classification, detection, or segmentation model. For your convenience, we have created [connectors](https://supervision.roboflow.com/latest/detection/core/#detections) for the most popular libraries like Ultralytics, Transformers, or MMDetection.\n\n```python\nimport cv2\nimport supervision as sv\nfrom ultralytics import YOLO\n\nimage = cv2.imread(...)\nmodel = YOLO(\"yolov8s.pt\")\nresult = model(image)[0]\ndetections = sv.Detections.from_ultralytics(result)\n\nlen(detections)\n# 5\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e👉 more model connectors\u003c/summary\u003e\n\n- inference\n\n    Running with [Inference](https://github.com/roboflow/inference) requires a [Roboflow API KEY](https://docs.roboflow.com/api-reference/authentication#retrieve-an-api-key).\n\n    ```python\n    import cv2\n    import supervision as sv\n    from inference import get_model\n\n    image = cv2.imread(...)\n    model = get_model(model_id=\"yolov8s-640\", api_key=\"ROBOFLOW_API_KEY\")\n    result = model.infer(image)[0]\n    detections = sv.Detections.from_inference(result)\n\n    len(detections)\n    # 5\n    ```\n\n\u003c/details\u003e\n\n### annotators\n\nSupervision offers a wide range of highly customizable [annotators](https://supervision.roboflow.com/latest/detection/annotators/), allowing you to compose the perfect visualization for your use case.\n\n```python\nimport cv2\nimport supervision as sv\n\nimage = cv2.imread(...)\ndetections = sv.Detections(...)\n\nbox_annotator = sv.BoxAnnotator()\nannotated_frame = box_annotator.annotate(scene=image.copy(), detections=detections)\n```\n\nhttps://github.com/roboflow/supervision/assets/26109316/691e219c-0565-4403-9218-ab5644f39bce\n\n### datasets\n\nSupervision provides a set of [utils](https://supervision.roboflow.com/latest/datasets/core/) that allow you to load, split, merge, and save datasets in one of the supported formats.\n\n```python\nimport supervision as sv\nfrom roboflow import Roboflow\n\nproject = Roboflow().workspace(\"WORKSPACE_ID\").project(\"PROJECT_ID\")\ndataset = project.version(\"PROJECT_VERSION\").download(\"coco\")\n\nds = sv.DetectionDataset.from_coco(\n    images_directory_path=f\"{dataset.location}/train\",\n    annotations_path=f\"{dataset.location}/train/_annotations.coco.json\",\n)\n\npath, image, annotation = ds[0]\n# loads image on demand\n\nfor path, image, annotation in ds:\n    # loads image on demand\n    pass\n```\n\n\u003cdetails close\u003e\n\u003csummary\u003e👉 more dataset utils\u003c/summary\u003e\n\n- load\n\n    ```python\n    dataset = sv.DetectionDataset.from_yolo(\n        images_directory_path=...,\n        annotations_directory_path=...,\n        data_yaml_path=...,\n    )\n\n    dataset = sv.DetectionDataset.from_pascal_voc(\n        images_directory_path=...,\n        annotations_directory_path=...,\n    )\n\n    dataset = sv.DetectionDataset.from_coco(\n        images_directory_path=...,\n        annotations_path=...,\n    )\n    ```\n\n- split\n\n    ```python\n    train_dataset, test_dataset = dataset.split(split_ratio=0.7)\n    test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5)\n\n    len(train_dataset), len(test_dataset), len(valid_dataset)\n    # (700, 150, 150)\n    ```\n\n- merge\n\n    ```python\n    ds_1 = sv.DetectionDataset(...)\n    len(ds_1)\n    # 100\n    ds_1.classes\n    # ['dog', 'person']\n\n    ds_2 = sv.DetectionDataset(...)\n    len(ds_2)\n    # 200\n    ds_2.classes\n    # ['cat']\n\n    ds_merged = sv.DetectionDataset.merge([ds_1, ds_2])\n    len(ds_merged)\n    # 300\n    ds_merged.classes\n    # ['cat', 'dog', 'person']\n    ```\n\n- save\n\n    ```python\n    dataset.as_yolo(\n        images_directory_path=...,\n        annotations_directory_path=...,\n        data_yaml_path=...,\n    )\n\n    dataset.as_pascal_voc(\n        images_directory_path=...,\n        annotations_directory_path=...,\n    )\n\n    dataset.as_coco(\n        images_directory_path=...,\n        annotations_path=...,\n    )\n    ```\n\n- convert\n\n    ```python\n    sv.DetectionDataset.from_yolo(\n        images_directory_path=...,\n        annotations_directory_path=...,\n        data_yaml_path=...,\n    ).as_pascal_voc(\n        images_directory_path=...,\n        annotations_directory_path=...,\n    )\n    ```\n\n\u003c/details\u003e\n\n## 🎬 tutorials\n\nWant to learn how to use Supervision? Explore our [how-to guides](https://supervision.roboflow.com/develop/how_to/detect_and_annotate/), [end-to-end examples](./examples), [cheatsheet](https://roboflow.github.io/cheatsheet-supervision/), and [cookbooks](https://supervision.roboflow.com/develop/cookbooks/)!\n\n\u003cbr/\u003e\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://youtu.be/hAWpsIuem10\" title=\"Dwell Time Analysis with Computer Vision | Real-Time Stream Processing\"\u003e\u003cimg src=\"https://github.com/SkalskiP/SkalskiP/assets/26109316/a742823d-c158-407d-b30f-063a5d11b4e1\" alt=\"Dwell Time Analysis with Computer Vision | Real-Time Stream Processing\" width=\"300px\" align=\"left\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://youtu.be/hAWpsIuem10\" title=\"Dwell Time Analysis with Computer Vision | Real-Time Stream Processing\"\u003e\u003cstrong\u003eDwell Time Analysis with Computer Vision | Real-Time Stream Processing\u003c/strong\u003e\u003c/a\u003e\n\u003cdiv\u003e\u003cstrong\u003eCreated: 5 Apr 2024\u003c/strong\u003e\u003c/div\u003e\n\u003cbr/\u003eLearn how to use computer vision to analyze wait times and optimize processes. This tutorial covers object detection, tracking, and calculating time spent in designated zones. Use these techniques to improve customer experience in retail, traffic management, or other scenarios.\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://youtu.be/uWP6UjDeZvY\" title=\"Speed Estimation \u0026 Vehicle Tracking | Computer Vision | Open Source\"\u003e\u003cimg src=\"https://github.com/SkalskiP/SkalskiP/assets/26109316/61a444c8-b135-48ce-b979-2a5ab47c5a91\" alt=\"Speed Estimation \u0026 Vehicle Tracking | Computer Vision | Open Source\" width=\"300px\" align=\"left\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://youtu.be/uWP6UjDeZvY\" title=\"Speed Estimation \u0026 Vehicle Tracking | Computer Vision | Open Source\"\u003e\u003cstrong\u003eSpeed Estimation \u0026 Vehicle Tracking | Computer Vision | Open Source\u003c/strong\u003e\u003c/a\u003e\n\u003cdiv\u003e\u003cstrong\u003eCreated: 11 Jan 2024\u003c/strong\u003e\u003c/div\u003e\n\u003cbr/\u003eLearn how to track and estimate the speed of vehicles using YOLO, ByteTrack, and Roboflow Inference. This comprehensive tutorial covers object detection, multi-object tracking, filtering detections, perspective transformation, speed estimation, visualization improvements, and more.\u003c/p\u003e\n\n## 💜 built with supervision\n\nDid you build something cool using supervision? [Let us know!](https://github.com/roboflow/supervision/discussions/categories/built-with-supervision)\n\nhttps://user-images.githubusercontent.com/26109316/207858600-ee862b22-0353-440b-ad85-caa0c4777904.mp4\n\nhttps://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c-60e9c81b3900\n\nhttps://github.com/roboflow/supervision/assets/26109316/3ac6982f-4943-4108-9b7f-51787ef1a69f\n\n## 📚 documentation\n\nVisit our [documentation](https://roboflow.github.io/supervision) page to learn how supervision can help you build computer vision applications faster and more reliably.\n\n## 🏆 contribution\n\nWe love your input! Please see our [contributing guide](.github/CONTRIBUTING.md) to get started. Thank you 🙏 to all our contributors!\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/roboflow/supervision/graphs/contributors\"\u003e\n      \u003cimg src=\"https://contrib.rocks/image?repo=roboflow/supervision\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cdiv align=\"center\"\u003e\n      \u003ca href=\"https://youtube.com/roboflow\"\u003e\n          \u003cimg\n            src=\"https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3\u0026updatedAt=1672949634652\"\n            width=\"3%\"\n          /\u003e\n      \u003c/a\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/\u003e\n      \u003ca href=\"https://roboflow.com\"\u003e\n          \u003cimg\n            src=\"https://media.roboflow.com/notebooks/template/icons/purple/roboflow-app.png?ik-sdk-version=javascript-1.4.3\u0026updatedAt=1672949746649\"\n            width=\"3%\"\n          /\u003e\n      \u003c/a\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/\u003e\n      \u003ca href=\"https://www.linkedin.com/company/roboflow-ai/\"\u003e\n          \u003cimg\n            src=\"https://media.roboflow.com/notebooks/template/icons/purple/linkedin.png?ik-sdk-version=javascript-1.4.3\u0026updatedAt=1672949633691\"\n            width=\"3%\"\n          /\u003e\n      \u003c/a\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/\u003e\n      \u003ca href=\"https://docs.roboflow.com\"\u003e\n          \u003cimg\n            src=\"https://media.roboflow.com/notebooks/template/icons/purple/knowledge.png?ik-sdk-version=javascript-1.4.3\u0026updatedAt=1672949634511\"\n            width=\"3%\"\n          /\u003e\n      \u003c/a\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/\u003e\n      \u003ca href=\"https://discuss.roboflow.com\"\u003e\n          \u003cimg\n            src=\"https://media.roboflow.com/notebooks/template/icons/purple/forum.png?ik-sdk-version=javascript-1.4.3\u0026updatedAt=1672949633584\"\n            width=\"3%\"\n          /\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png\" width=\"3%\"/\u003e\n      \u003ca href=\"https://blog.roboflow.com\"\u003e\n          \u003cimg\n            src=\"https://media.roboflow.com/notebooks/template/icons/purple/blog.png?ik-sdk-version=javascript-1.4.3\u0026updatedAt=1672949633605\"\n            width=\"3%\"\n          /\u003e\n      \u003c/a\u003e\n      \u003c/a\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Python","对象检测、分割","Object Detection Applications","Repos","Industry Strength Computer Vision","CV","🛸 Other"],"sub_categories":["网络服务_其他","3. CV Application","🖌️ Image annotation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboflow%2Fsupervision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froboflow%2Fsupervision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboflow%2Fsupervision/lists"}