basetrack
TrackState
TrackState (value, names=None, module=None, qualname=None, type=None, start=1)
Enum class to represent the possible states of a track.
Attributes:
- New: The initial state of the track when it’s just detected.
- Tracked: The state when the track is being actively tracked.
- Lost: The state when the track is lost or not detected in the current frame.
- Removed: The state when the track is removed from the tracking system.
BaseTrack
BaseTrack ()
Base class for a track in a tracking system.
This class provides the basic functionalities and properties for a track, such as its unique ID, state, history, features, and related functions. Derived classes should implement the activate, predict, and update methods.
Attributes:
_count
(int): Class-level counter to generate unique IDs for tracks.
BaseTrack.end_frame
BaseTrack.end_frame ()
Returns the current frame number as the end frame of the track.
BaseTrack.next_id
BaseTrack.next_id ()
Generates and returns the next unique track ID.
BaseTrack.activate
BaseTrack.activate (*args)
Activates the track. This method should be implemented by derived classes.
Raises: NotImplementedError: If the method is not implemented by derived classes.
BaseTrack.predict
BaseTrack.predict ()
Predicts the next state of the track. This method should be implemented by derived classes.
Raises: NotImplementedError: If the method is not implemented by derived classes.
BaseTrack.update
BaseTrack.update (*args, **kwargs)
Updates the state of the track based on new observations. This method should be implemented by derived classes.
Raises: NotImplementedError: If the method is not implemented by derived classes.
BaseTrack.mark_lost
BaseTrack.mark_lost ()
Marks the track as lost.
BaseTrack.mark_removed
BaseTrack.mark_removed ()
Marks the track as removed.