$ show roboflow/supervision
Supervision is a model-agnostic computer vision utility library developed by Roboflow. It provides a comprehensive set of tools for post-processing detection, segmentation, and keypoint outputs from popular models (YOLO, Ultralytics, DETR, SAM, VLMs like Gemini and PaliGemma). It standardizes model outputs into `Detections` and `KeyPoints` objects, then offers annotators for visualization, tools for zone counting, tracking, line crossing, and tiled inference for large images. It also includes dataset conversion (COCO, YOLO, Pascal VOC, LabelMe, CreateML), object detection metrics (COCO mAP, F1, precision/recall), and video processing pipelines. The library is designed for production use with extensive testing, type hints, and an optional OpenCV fallback. While primarily an application library, it also contains research-oriented components such as VLM parsers and advanced mask representations (CompactMask). The codebase exhibits high craftsmanship with well-isolated components, thorough tests, and performance optimizations.
The LLM identified 4 files worth highlighting for reuse:
A memory-efficient RLE-based mask container that crops masks to bounding boxes, providing array-like operations (indexing, concatenation, area, IoU) without materializing full-resolution masks. It supports dense-to-RLE, COCO RLE ingestion, and includes optimized union/resize/offset operations. Reusable in any project needing foreground mask storage for large images.
A configurable tiled inference engine that splits a large image into overlapping patches, runs an inference function on each, and merges results with NMS/NMM, handling compact masks and oriented bounding boxes. Supports batching, threading, and metadata reconciliation. Reusable as a standalone utility for any model inference on large images.
A collection of parsers that convert raw text/JSON outputs from vision-language models (Gemini, PaliGemma, Qwen, Florence-2, DeepSeek, Moondream, Kosmos-2) into structured `Detections` objects. Each parser handles model-specific formatting, coordinate scaling, and malformed recovery. The pattern of an enum with per-model methods is a clean adapter design reusable for new VLM models.
Full round-trip COCO dataset loading and saving with support for bounding boxes, polygon and RLE segmentation, iscrowd and ignore flags, and path-traversal protection. Includes COCO-compatible RLE encode/decode (base48+delta codec) with NumPy interop. Reusable for any project needing COCO dataset I/O.