Expand description
§yscv-detect
Object detection pipeline: YOLOv8/v11 decoding, NMS, heatmap detection, ROI pooling, and anchor generation.
ⓘ
use yscv_detect::*;
let detections = detect_people_from_rgb8(width, height, &rgb_data, 0.5, 3, 0.45, 100)?;
for det in &detections {
println!("{}: {:.0}% at ({}, {}, {}, {})",
det.label, det.score * 100.0, det.x, det.y, det.w, det.h);
}§Features
- YOLO decoding: YOLOv8 and YOLOv11 output tensor parsing with letterbox preprocessing
- NMS: standard, soft-NMS, batched (class-aware), with early exit optimization
- Heatmap detection: keypoint-based detection with local maxima suppression
- ROI ops: ROI pooling and bilinear ROI align
- Anchors: multi-scale anchor generation for SSD/Faster R-CNN
- Scratch buffers: zero-alloc detection with reusable scratch objects
§Optional Features
[features]
onnx = [] # ONNX model inference via yscv-onnx§Tests
60 tests covering decoding, NMS edge cases, ROI alignment.
Structs§
- Bounding
Box - Axis-aligned box in image coordinates.
- Detection
- One detection with score and class id.
- Frame
Face Detect Scratch - Reusable scratch storage for frame-based face detection.
- Frame
People Detect Scratch - Reusable scratch storage for frame-based people detection.
- Heatmap
Detect Scratch - Reusable scratch storage for connected-component heatmap detection.
- Model
Detector Config - Configuration for a model-based detector.
- Rgb8
Face Detect Scratch - Reusable scratch storage for RGB8 face detection.
- Rgb8
People Detect Scratch - Reusable scratch storage for RGB8 people detection.
- Yolo
Config - YOLO model configuration.
Enums§
Constants§
Traits§
- Model
Detector - Abstract interface for model-backed object detectors.
Functions§
- batched_
nms - Per-class (batched) NMS.
- coco_
labels - Returns the 80 COCO class labels.
- decode_
yolov8_ output - Decode YOLOv8 raw output tensor into detections.
- decode_
yolov11_ output - Decode YOLOv11 output tensor into detections.
- detect_
faces_ from_ frame - Heuristic face detector over RGB frames using a skin-probability heatmap.
- detect_
faces_ from_ frame_ with_ scratch - Heuristic face detector over RGB frames with reusable scratch storage.
- detect_
faces_ from_ rgb8 - Heuristic face detector over raw RGB8 bytes.
- detect_
faces_ from_ rgb8_ with_ scratch - Heuristic face detector over raw RGB8 bytes with reusable scratch storage.
- detect_
from_ heatmap - Connected-component detector over heatmaps
[H, W, 1]. - detect_
from_ heatmap_ with_ scratch - Connected-component detector over heatmaps
[H, W, 1]with reusable scratch storage. - detect_
people_ from_ frame - Convenience adapter from frame to heatmap-based detection.
- detect_
people_ from_ frame_ with_ scratch - Convenience adapter from frame to heatmap-based detection with reusable scratch storage.
- detect_
people_ from_ rgb8 - People detector over raw RGB8 bytes.
- detect_
people_ from_ rgb8_ with_ scratch - People detector over raw RGB8 bytes with reusable scratch storage.
- detect_
yolov8_ from_ rgb - Run the full YOLOv8 detection pipeline on an HWC image.
- detect_
yolov8_ onnx - Run YOLOv8 inference using an ONNX model.
- generate_
anchors - Generates anchor boxes for a feature map.
- iou
- Computes IoU for two axis-aligned boxes.
- letterbox_
preprocess - Apply letterbox preprocessing: resize an image to a square with padding.
- non_
max_ suppression - Standard score-sorted NMS.
- postprocess_
detections - Post-processes raw model output into final detections.
- preprocess_
rgb8_ for_ model - Preprocess an RGB8 image for model input.
- roi_
align - RoI Align: bilinear-interpolation version of RoI pooling (no quantisation).
- roi_
pool - RoI Pooling: for each RoI, divides the region into an
output_sizegrid and max-pools each cell. - soft_
nms - Soft-NMS with Gaussian decay.
- yolov8_
coco_ config - Returns the default YOLOv8 config for the COCO 80-class dataset.
- yolov11_
coco_ config - Default COCO config for YOLOv11 models.