
--------------------------------------------------------------------------------
-- YOLO tracker module
--------------------------------------------------------------------------------

---@class yolo_tracker_options*
---@field iou_threshold? number Associated IoU thresholds
---@field max_age? integer Maximum number of reserved frames
---@field min_hits? integer Minimum number of hits

---@class yolo_tracker_detection*
---@field box number[] detection frame
---@field score? number Confidence
---@field class_id? integer Category ID
---@field points? table[] point list
---@field keypoints? table[] key point list
---@field track_id? integer Tracking ID
---@field track_hits? integer Number of hits
---@field track_age? integer Track age

---@class yolo_tracker*
---@field closed boolean Is it closed
---@field config yolo_tracker_options* Trace configuration
---@field tracks onnxruntime_track[] tracking status
---@field next_id integer Next tracking ID
local yolo_tracker = {}

--- Update tracker
---@param detections yolo_tracker_detection*[] Test results
---@param timestamp? integer Timestamp
---@return yolo_tracker_detection*[] detections Detection results with tracking fields
function yolo_tracker:update(detections, timestamp) end

--- Reset tracker
---@return boolean ok Is it successful?
function yolo_tracker:reset() end

--- Get tracking status
---@return onnxruntime_track[] tracks tracking status
function yolo_tracker:state() end

--- Turn off trackers
---@return boolean ok Is it successful?
function yolo_tracker:close() end

---@class yolo_tracker_module*
---@type yolo_tracker_module*
local M = {}

--- Create tracker
---@param config? yolo_tracker_options* Trace configuration
---@return yolo_tracker*|onnxruntime_tracker*|coreml_tracker* tracker tracker
function M.tracker(config) end

return M
