roboflow /supervision

We write your reusable computer vision tools. 💜

★ 51,633⑂ 4,958👁 289⑃ 2,092● 595▤ 57
PythonMITCreated 2022-11-28supervision.roboflow.com
More from this author
Download: supervision-0.31.7supervision-0.31.7 ↓0.31.72026-11-11
+8
Daily
+70
Weekly
+453
Monthly
51,633
stars
4,958
forks
289
watchers
2,092
prs
595
issues
57
releases

README

notebooks | inference | autodistill | maestro



    

   


    
  




📑 Table of Contents

- 👋 Hello
- 💻 Install
- 🔥 Quickstart
  - Models
  - Annotators
  - Datasets
- 🎬 Tutorials
- 💜 Built with Supervision
- 📚 Documentation
- 🏆 Contribution



 👋 Hello

We are your essential toolkit for computer vision. From data loading to real-time zone counting, we provide the building blocks so you can focus on building applications around your models. 🤝

 💻 Install

Pip install the supervision package in a Python=3.10 environment.

bash
pip install supervision


Read more about conda, mamba, and installing from source in our guide.

 🔥 Quickstart

 Models

Supervision was designed to be model agnostic. Just plug in any classification, detection, or segmentation model. For your convenience, we have created connectors for the most popular libraries like Ultralytics, Transformers, MMDetection, or Inference. Other integrations, like rfdetr, already return sv.Detections directly.

Install the optional dependencies for this example with pip install pillow rfdetr.

python
import supervision as sv
from PIL import Image
from rfdetr import RFDETRSmall

image = Image.open("path/to/image.jpg")
model = RFDETRSmall()
detections = model.predict(image, threshold=0.5)

len(detections)
 5



👉 more model connectors

- inference

  Running with Inference requires a Roboflow API KEY.

  python
  import supervision as sv
  from PIL import Image
  from inference import get_model

  image = Image.open("path/to/image.jpg")
  model = get_model(model_id="rfdetr-small", api_key="ROBOFLOW_API_KEY")
  result = model.infer(image)[0]
  detections = sv.Detections.from_inference(result)

  len(detections)
   5
  



 Annotators

Supervision offers a wide range of highly customizable annotators, allowing you to compose the perfect visualization for your use case.

python
import cv2
import supervision as sv

image = cv2.imread("path/to/image.jpg")
 Assuming detections are obtained from a model
detections = sv.Detections(...)

box_annotator = sv.BoxAnnotator()
annotated_frame = box_annotator.annotate(scene=image.copy(), detections=detections)


https://github.com/roboflow/supervision/assets/26109316/691e219c-0565-4403-9218-ab5644f39bce

 Datasets

Supervision provides a set of utils that allow you to load, split, merge, and save datasets in one of the supported formats.

python
import supervision as sv
from roboflow import Roboflow

project = Roboflow().workspace("WORKSPACE_ID").project("PROJECT_ID")
dataset = project.version("PROJECT_VERSION").download("coco")

ds = sv.DetectionDataset.from_coco(
    images_directory_path=f"{dataset.location}/train",
    annotations_path=f"{dataset.location}/train/_annotations.coco.json",
)

path, image, annotation = ds[0]
 loads image on demand

for path, image, annotation in ds:
     loads image on demand
    pass



👉 more dataset utils

- load

  python
  dataset = sv.DetectionDataset.from_yolo(
      images_directory_path=...,
      annotations_dire

Top issues

Discussions

Latest release

supervision-0.31.7 0.31.7 2026-11-11
v0.31.7: pycocotools-matching mAP, stricter key point and CSV inputs, and edge-case fixes for zones and dataset exports

A fixes-only patch: mAP now matches pycocotools more closely, and several zone, key point and export edge cases stop failing.

- MeanAveragePrecision uses pycocotools size buckets and the COCO crowd IoU for oriented-box crowd targets.
- PolygonZone keeps its full mask when polygon coordinates reach their integer limit.
- Key point selection and CSVSink now raise on inputs they used to silently misread.
- DetectionDataset exports keep box area for empty COCO masks and,

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON