Skip to main content

edgefirst_tracker/
lib.rs

1// SPDX-FileCopyrightText: Copyright 2025 Au-Zone Technologies
2// SPDX-License-Identifier: Apache-2.0
3
4use std::fmt::Debug;
5
6use uuid::Uuid;
7
8pub mod bytetrack;
9mod kalman;
10
11pub trait DetectionBox: Debug {
12    fn bbox(&self) -> [f32; 4];
13    fn score(&self) -> f32;
14    fn label(&self) -> usize;
15}
16
17#[derive(Debug, Clone, Copy)]
18pub struct TrackInfo {
19    pub uuid: Uuid,
20    pub tracked_location: [f32; 4],
21    pub count: i32,
22    pub created: u64,
23    pub last_updated: u64,
24}
25
26pub trait Tracker<T: DetectionBox> {
27    fn update(&mut self, boxes: &[T], timestamp: u64) -> Vec<Option<TrackInfo>>;
28
29    fn get_active_tracks(&self) -> Vec<TrackInfo>;
30}