Skip to main content

Crate visloc_objects

Crate visloc_objects 

Source
Expand description

Image-space multi-object tracking: the first stage of metric object estimation from monocular VI-SLAM (docs/object_metric_slam_plan.md, Phase 1).

ByteTracker links per-frame detections into tracks with stable IDs, the ByteTrack way: a box Kalman filter (BoxKalmanFilter), IoU costs, an optimal assignment (assign_with_cost_limit), and a second pass over the low-score detections that keeps partly occluded objects. It takes Detections from any ObjectDetector: ReplayDetector replays stored boxes, and YoloxOnnxDetector runs a YOLOX model with ONNX Runtime (the onnx-inference feature; yolox has its pre- and post-processing). MotAccumulator scores tracks against ground truth with the CLEAR MOT metrics.

With metric camera poses from the VIO, the tracks become metric objects (Phase 3): metric triangulates static objects and fits upright boxes, and ground puts objects that stand on the ground, moving or not, on it for their height, position and speed.

use visloc_objects::{BBox, ByteTracker, Detection};

let mut tracker = ByteTracker::default();
for frame in 0..3 {
    let x = 100.0 + 5.0 * frame as f64;
    let detections = [Detection::new(BBox::from_xywh(x, 50.0, 40.0, 80.0), 0.9, 0)];
    let tracks = tracker.update(&detections);
    assert_eq!(tracks.len(), 1);
    assert_eq!(tracks[0].id.0, 1);
}

Re-exports§

pub use assignment::assign_with_cost_limit;
pub use assignment::Assignment;
pub use bbox::BBox;
pub use bbox::Detection;
pub use byte_track::ByteTrackConfig;
pub use byte_track::ByteTracker;
pub use byte_track::TrackId;
pub use byte_track::TrackedObject;
pub use detector::ObjectDetector;
pub use detector::ReplayDetector;
pub use detector::ReplayExhausted;
pub use ground::estimate_ground_height;
pub use ground::place_on_ground;
pub use ground::place_on_local_ground;
pub use ground::plausible_height;
pub use ground::summarize_ground_track;
pub use ground::BoxRays;
pub use ground::GroundObservation;
pub use ground::GroundParams;
pub use ground::GroundTrack;
pub use ground::GroundTrackParams;
pub use ground::GroundView;
pub use ground::PathGround;
pub use image::ImageSizeError;
pub use image::RgbImage;
pub use kalman::BoxKalmanFilter;
pub use kalman::BoxKalmanState;
pub use metric::estimate_static_object;
pub use metric::fit_upright_box;
pub use metric::plausible_size;
pub use metric::triangulate;
pub use metric::BearingObservation;
pub use metric::BoxFitParams;
pub use metric::ObjectEstimate;
pub use metric::ScaleSource;
pub use metric::TriangulationParams;
pub use metric::UprightBox;
pub use mot_eval::MotAccumulator;
pub use mot_eval::MotSummary;
pub use yolox::YoloxConfig;
pub use yolox::COCO_CLASSES;
pub use yolox::MOVABLE_COCO_CLASSES;
pub use yolox_onnx::YoloxOnnxDetector;
pub use yolox_onnx::YoloxOnnxError;

Modules§

assignment
Minimum-cost assignment between tracks and detections.
bbox
Axis-aligned image boxes and detections.
byte_track
ByteTrack: multi-object tracking by associating every detection box.
detector
The object-detector boundary.
ground
Metric size, position and speed of objects standing on the ground (Phase 3 of docs/object_metric_slam_plan.md, moving objects).
image
8-bit RGB images, the input of the object detectors.
kalman
Constant-velocity Kalman filter on image boxes, as in SORT, DeepSORT and ByteTrack.
metric
Metric 3D objects from object tracks and metric camera poses (Phase 3 of docs/object_metric_slam_plan.md, static objects).
mot_eval
CLEAR MOT metrics (Bernardin and Stiefelhagen, 2008) for 2D box tracks.
yolox
YOLOX (Ge et al., “YOLOX: Exceeding YOLO Series in 2021”) pre- and post-processing, independent of the inference runtime.
yolox_onnx
YOLOX inference with ONNX Runtime.