edgefirst-decoder
High-performance ML model output decoding for object detection and segmentation.
This crate provides efficient post-processing for YOLO and ModelPack model outputs, supporting both floating-point and quantized inference results.
Supported Models
| Family | Detection | Segmentation | Formats |
|---|---|---|---|
| YOLO | YOLOv5, v8, v11 | Instance seg | float32, int8, uint8 |
| ModelPack | SSD-style | Semantic seg | float32, int8, uint8 |
Features
- Quantized decoding - Direct int8/uint8 processing without dequantization overhead
- Configurable NMS - Class-agnostic or class-aware non-maximum suppression
- Batch processing - Efficient handling of batched model outputs
- Builder pattern - Flexible configuration with sensible defaults
Quick Start
use ;
// Build decoder from model config
let decoder = new
.with_score_threshold
.with_iou_threshold
.with_config_json_str
.build?;
// Decode quantized model output
let mut detections: = Vecwith_capacity;
let mut masks: = Vecwith_capacity;
decoder.decode_quantized?;
// Process results
for det in &detections
Low-Level API
For known model types, use the direct decoding functions:
use decode_yolo_det;
use Quantization;
let mut detections = Vecwith_capacity;
decode_yolo_det;
Configuration
Decoders can be configured via JSON/YAML matching the model's output specification:
NMS Modes
ClassAgnostic- Suppress overlapping boxes regardless of class (default)ClassAware- Only suppress boxes with the same class labelNone- Bypass NMS (for models with built-in NMS)
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.