Expand description
warden-vision: reusable computer vision building blocks for
detection, tracking, and annotation, mirroring the API shape of
Roboflow’s Python supervision library.
§Modules
core:core::Detection/core::Detections, the shared currency between detectors, trackers, zones, and annotators, pluscore::KeyPoints(pose/landmark data,core::COCO_17_EDGESskeleton),core::Classifications(whole-image classification),core::InferenceSlicer(tiled/SAHI-style inference), andcore::Detections::from_ultralytics_onnx/core::Detections::from_transformers_onnxfor parsing raw detector output tensors (see their docs for why these parse tensors rather than binding toultralytics/transformersobjects).geometry:geometry::Point,geometry::Rect, the anchor-pointgeometry::Positionenum, polygon utilities (geometry::polygon_area,geometry::polygon_centroid,geometry::polygon_to_rect), thegeometry::Zonetrait, and itsgeometry::LineZone/geometry::PolygonZoneimplementations.tracker:tracker::SortTracker(single-stage Kalman + IoU) andtracker::ByteTracker(two-stage high/low-confidence matching, after Zhang et al.’s ByteTrack), both assigningcore::Detection::tracker_id;tracker::DetectionsSmootherto damp jitter in a tracked box across frames.annotators: theannotators::Annotatortrait and a family of drawing configs — boxes (round-cornered, corner-only), masks, polygons, labels (bitmap font, or underannotate-imagereal TTF/OTF viaannotators::RichLabelAnnotator), circles, dots, triangles, ellipses, motion traces, heat maps, halos, percentage bars, icon overlays, background dimming, blur/pixelate redaction, zone outlines, and keypoint skeletons — with pure-Rust (annotate-image) and OpenCV (annotate-opencv) rendering backends (RichLabelAnnotatoris pure-Rust only; see its docs for why).metrics:metrics::Precision,metrics::Recall,metrics::F1Score,metrics::ConfusionMatrix,metrics::MeanAveragePrecision, andmetrics::MeanAverageRecallfor scoring predictedcore::Detectionsagainst ground truth.utils:utils::FPSMonitorfor throughput reporting, plus (underannotate-image)utils::resize_keeping_aspect_ratio,utils::letterbox,utils::crop_image,utils::overlay_image, andutils::ImageSinkfor writing a numbered frame sequence.dataset(underdatasets):dataset::DetectionDatasetplus COCO (dataset::coco), YOLO (dataset::yolo), and Pascal VOC (dataset::pascal_voc) loaders/exporters, anddataset::ClassificationDatasetwith an image-folder-per-class loader/exporter (dataset::classification).video(underannotate-opencv):video::VideoInfo,video::frames, andvideo::VideoSinkfor reading and writing video files via OpenCV’svideoio.
(Items behind a non-default feature are written above as plain
code text rather than intra-doc links, since those links only
resolve when this crate’s docs are built with that feature enabled.
The published docs build with annotate-image and datasets — see
[package.metadata.docs.rs] in Cargo.toml — but not
annotate-opencv, since docs.rs has no system OpenCV install; read
video’s module docs directly in src/video/mod.rs instead.)
§Scope
This crate targets the core, dependency-light building blocks of
Roboflow’s supervision: detection/keypoint/classification data
structures, geometry, tracking, annotation, evaluation metrics,
dataset I/O, image utilities, and OpenCV-backed video I/O. Remaining
known gaps: RichLabelAnnotator has no annotate-opencv
implementation (OpenCV has no built-in TTF rendering without
FreeType); a dedicated OrientedBoxAnnotator doesn’t exist since
annotators::PolygonAnnotator already draws an arbitrary 4-point
rotated box stored in core::Detection::mask; and detector-output
parsing covers Ultralytics YOLO and DETR-family transformers models
(the two most common) rather than every framework supervision has
an adapter for.
Re-exports§
Modules§
- annotators
- Backend-agnostic annotation: drawing detections and zone counters onto an image or video frame.
- core
- Core data structures: detections and the value types built on top of them.
- dataset
- Dataset loaders and exporters: three object-detection annotation
formats (
coco,yolo,pascal_voc) built around the sharedDetectionDatasetshape, plus a folder-per-class classification layout (classification) built aroundClassificationDataset. - error
- Shared error type for
warden-vision. - geometry
- Spatial primitives and zones: points, counting lines, and polygonal regions of interest.
- metrics
- Evaluation metrics for comparing predicted
crate::core::Detectionsagainst ground-truth annotations:Precision,Recall,F1Score,ConfusionMatrix,MeanAveragePrecision, andMeanAverageRecall. - tracker
- Multi-object tracking: Kalman motion prediction and IoU-based association.
- utils
- Small standalone utilities that don’t belong to any single pipeline
stage:
FPSMonitorfor throughput reporting, and (under theannotate-imagefeature) pure-Rust image helpers.