π₯ roboflow/supervision
We write your reusable computer vision tools. π β Trending on GitHub today with 535 new stars.
π hello
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! π€
π» install
Pip install the supervision package in a Python>=3.9 environment.
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.
import supervision as sv from PIL import Image from rfdetr import RFDETRSmallimport supervision as sv from PIL import Image from rfdetr import RFDETRSmallimage = Image.open(...) model = RFDETRSmall() detections = model.predict(image, threshold=0.5)
len(detections)
5`
π more model connectors
- inference
Running with Inference requires a Roboflow API KEY.
import supervision as sv from PIL import Image from inference import get_model
image = Image.open(...) 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.
import cv2 import supervision as svimport cv2 import supervision as svimage = cv2.imread(...) detections = sv.Detections(...)
box_annotator = sv.BoxAnnotator() annotated_frame = box_annotator.annotate(scene=image.copy(), detections=detections)`
supervision-0.16.0-annotators.mp4
datasets
Supervision provides a set of utils that allow you to load, split, merge, and save datasets in one of the supported formats.
import supervision as sv from roboflow import Roboflowimport supervision as sv from roboflow import Roboflowproject = 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
dataset = sv.DetectionDataset.from_yolo( images_directory_path=..., annotations_directory_path=..., data_yaml_path=..., )
dataset = sv.DetectionDataset.from_pascal_voc( images_directory_path=..., annotations_directory_path=..., )
dataset = sv.DetectionDataset.from_coco( images_directory_path=..., annotations_path=..., )
- split
train_dataset, test_dataset = dataset.split(split_ratio=0.7) test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5)
len(train_dataset), len(test_dataset), len(valid_dataset)
(700, 150, 150)
- merge
ds_1 = sv.DetectionDataset(...) len(ds_1)
100
ds_1.classes
['dog', 'person']
ds_2 = sv.DetectionDataset(...) len(ds_2)
200
ds_2.classes
['cat']
ds_merged = sv.DetectionDataset.merge([ds_1, ds_2]) len(ds_merged)
300
ds_merged.classes
['cat', 'dog', 'person']
- save
dataset.as_yolo( images_directory_path=..., annotations_directory_path=..., data_yaml_path=..., )
dataset.as_pascal_voc( images_directory_path=..., annotations_directory_path=..., )
dataset.as_coco( images_directory_path=..., annotations_path=..., )
- convert
sv.DetectionDataset.from_yolo( images_directory_path=..., annotations_directory_path=..., data_yaml_path=..., ).as_pascal_voc( images_directory_path=..., annotations_directory_path=..., )
π¬ tutorials
Want to learn how to use Supervision? Explore our how-to guides, end-to-end examples, cheatsheet, and cookbooks!
Dwell Time Analysis with Computer Vision | Real-Time Stream Processing
Created: 5 Apr 2024
Learn 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.
Speed Estimation & Vehicle Tracking | Computer Vision | Open Source
Created: 11 Jan 2024
Learn 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.
π built with supervision
Did you build something cool using supervision? Let us know!
football-players-tracking-25.mp4
traffic_analysis_result.mov
vehicles-step-7-new.mp4
π documentation
Visit our documentation page to learn how supervision can help you build computer vision applications faster and more reliably.
π contribution
We love your input! Please see our contributing guide to get started. Thank you π to all our contributors!
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
githubtrendingopen-source
More, and More Extensive, Supply Chain Attacks
Open source components are getting compromised a lot more often. I did some counting, with a combination of searching, memory, and AI assistance, and we had two in 2026-Q1 ( trivy , axios ), after four in 2025 ( shai-hulud , glassworm , nx , tj-actions ), and very few historically [1]: Earlier attacks were generally compromises of single projects, but some time around Shai-Hulud in 2025-11 there started to be a lot more ecosystem propagation. Things like the Trivy compromise leading to the LiteLLM compromise and (likely, since it was three days later and by the same attackers) Telnyx . I only counted the first compromise in chain in the chart, but if we counted each one the increase would be much more dramatic. Similarly, I only counted glassworm for 2025, when it came out, but it's still

Vector researcher Wenhu Chen on improving and benchmarking foundation models
By Wenhu Chen The past year has seen great progress in foundation models as they achieve expert-level performance in solving challenging, real-world problems. In early 2023, the best open-source 7B [ ] The post Vector researcher Wenhu Chen on improving and benchmarking foundation models appeared first on Vector Institute for Artificial Intelligence .
Knowledge Map
Connected Articles β Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Open Source AI

A Quick Note on Gemma 4 Image Settings in Llama.cpp
In my last post, I mentioned using --image-min-tokens to increase the quality of image responses from Qwen3.5 . I went to load Gemma 4 the same way, and hit an error: [58175] srv process_chun: processing image... [58175] encoding image slice... [58175] image slice encoded in 7490 ms [58175] decoding image batch 1/2, n_tokens_batch = 2048 [58175] /Users/socg/llama.cpp-b8639/src/llama-context.cpp:1597: GGML_ASSERT((cparams.causal_attn || cparams.n_ubatch > = n_tokens_all ) "non-causal attention requires n_ubatch >= n_tokens" ) failed [58175] WARNING: Using native backtrace. Set GGML_BACKTRACE_LLDB for more info. [58175] WARNING: GGML_BACKTRACE_LLDB may cause native MacOS Terminal.app to crash. [58175] See: https://github.com/ggml-org/llama.cpp/pull/17869 [58175] 0 libggml-base.0.9.11.dylib 0


Discussion
Sign in to join the discussion
No comments yet β be the first to share your thoughts!