chariot.tracker package

Submodules

chariot.tracker.models module

class chariot.tracker.models.ExternalTrackerInput(*, project_id: str, model_id: str, inference_id: str, ts: str, sequence_number: int = 0, modified_state_transition_matrix: list[list[float]] | None = None, modified_process_noise_covariance_matrix: list[list[float]] | None = None, unitless_box_localization_metadata: UnitlessBoxLocalizationMetadata | None = None)[source]

Bases: BaseModel

inference_id: str
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_id: str
modified_process_noise_covariance_matrix: list[list[float]] | None
modified_state_transition_matrix: list[list[float]] | None
project_id: str
sequence_number: int
ts: str
unitless_box_localization_metadata: UnitlessBoxLocalizationMetadata | None
class chariot.tracker.models.GeoPoint(*, latitude: float, longitude: float)[source]

Bases: BaseModel

Defines a point on the globe.

Parameters:
  • latitude (float) – A latitude value in decimal format between -90 and 90.

  • longitude (float) – A longitude value in decimal format between -180 and 180.

latitude: float
longitude: float
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class chariot.tracker.models.LatLongPoint(*, label: str, score: float, covariance: list[list[float]] = <factory>, id: str, latitude: float, longitude: float)[source]

Bases: Measurement

latitude: float
longitude: float
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod validate_covariance(v)[source]
class chariot.tracker.models.Measurement(*, label: str, score: float, covariance: list[list[float]] = <factory>, id: str)[source]

Bases: BaseModel

covariance: list[list[float]]
id: str
label: str
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

score: float
class chariot.tracker.models.NewCreateTrackerRequest(*, project_id: str, name: str, kind: TrackerKind, max_missing_updates: int, min_lifetime_before_active: int, assignment_function: TrackerAssignmentFunction, assignment_threshold: float, label_behavior: TrackerLabelBehavior, state_transition: list[list[float]] | None = None, process_noise_covariance: list[list[float]] | None = None)[source]

Bases: BaseModel

assignment_function: TrackerAssignmentFunction
assignment_threshold: float
check_process_noise_covariance()[source]
check_state_transition()[source]
kind: TrackerKind
label_behavior: TrackerLabelBehavior
max_missing_updates: int
min_lifetime_before_active: int
model_config: ClassVar[ConfigDict] = {'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
process_noise_covariance: list[list[float]] | None
project_id: str
state_transition: list[list[float]] | None
class chariot.tracker.models.NewStoreTracksRequest(*, tracker_id: str, tracker_kind: str, project_id: str, model_id: str, inference_id: str, ts: str, sequence_number: int | None = None, tracks: list[Track] = [])[source]

Bases: BaseModel

Defines a store tracks request.

Parameters:
  • tracker_id (str) – The tracker providing track outputs.

  • tracker_kind (str) – The kind of tracker.

  • project_id (str) – The project containing the tracker.

  • model_id (str) – The model providing the inference.

  • inference_id (str) – The inference being used to update the tracker.

  • ts (str) – The timestamp indicating when the frame/packet/entity arrived at the sensor.

  • sequence_number (int) – An optional monotonically increasing integer such as a frame number.

  • tracks (list[Track]) – The collection of tracks.

inference_id: str
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_id: str
project_id: str
sequence_number: int | None
tracker_id: str
tracker_kind: str
tracks: list[Track]
ts: str
class chariot.tracker.models.NewUpdateTrackerRequest(*, tracker_id: str, external_input: ~chariot.tracker.models.ExternalTrackerInput, points_unitless: list[~chariot.tracker.models.UnitlessPoint] = <factory>, points_lat_long: list[~chariot.tracker.models.LatLongPoint] = <factory>, points_utm: list[~chariot.tracker.models.UTMPoint] = <factory>, boxes_unitless: list[~chariot.tracker.models.UnitlessBox] = <factory>, wait_for_output: bool = False, wait_time: float = 100.0)[source]

Bases: BaseModel

boxes_unitless: list[UnitlessBox]
external_input: ExternalTrackerInput
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

points_lat_long: list[LatLongPoint]
points_unitless: list[UnitlessPoint]
points_utm: list[UTMPoint]
tracker_id: str
wait_for_output: bool
wait_time: float
class chariot.tracker.models.Track(*, track_id: str | None, created_at: datetime | None, updated_at: datetime | None, measurement_id: str = None, lifetime: int | None, total_updates: int | None, total_missed_updates: int | None, consecutive_updates: int | None, consecutive_missed_updates: int | None, status: str | None, label: str | None, measurement: dict | None, measurement_uncertainty: list[list[float]] | None, predicted_estimated_state: dict | None, estimated_state: dict | None, estimated_state_uncertainty: list[list[float]] | None, cost: float | None, coordinate: GeoPoint | None = None)[source]

Bases: BaseModel

Defines an object track.

Parameters:
  • track_id (Optional[str]) – The reference ID for the track.

  • created_at (Optional[str]) – A timestamp of when the inference was created.

  • updated_at (Optional[str]) – A timestamp of when the inference was last updated.

  • measurement_id (Optional[str]) – The measurement/detection level ID within the inference response.

  • lifetime (int | None) – The count of frames the track has been alive for.

  • total_updates (int | None) – The number of total updates in which a measurement has been associated to the track.

  • total_missed_updates (int | None) – The number of total missed updates in which a measurement has not been associated to the track.

  • consecutive_updates (int | None) – The total count of consecutive updates via measurement.

  • consecutive_missed_updates (int | None) – The count of consecutive missed updates. If this exceeds the tracker’s max_missed_updates, the track status should be “lost”.

  • status (Optional[str]) – The track status: [new, active, lost].

  • label (Optional[str]) – The track class label.

  • measurement (Optional[dict]) – The measurement used to update the tracker.

  • measurement_uncertainty (Optional[list[list[float]]]) – The measurement uncertainty used to update the tracker.

  • predicted_estimated_state (Optional[dict]) – The track’s predicted estimate position/state before a potential measurement assignment

  • estimated_state (Optional[dict]) – The track’s updated estimate position/state after a potential measurement assignment

  • estimated_state_uncertainty (Optional[list[list[float]]]) – The track’s state estimate uncertainty

  • cost (Optional[float]) – The cost value from the assignment function.

  • coordinate (GeoPoint | None) – The coordinate associated with the track.

consecutive_missed_updates: int | None
consecutive_updates: int | None
coordinate: GeoPoint | None
cost: float | None
created_at: datetime | None
estimated_state: dict | None
estimated_state_uncertainty: list[list[float]] | None
label: str | None
lifetime: int | None
measurement: dict | None
measurement_id: str
measurement_uncertainty: list[list[float]] | None
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

predicted_estimated_state: dict | None
status: str | None
total_missed_updates: int | None
total_updates: int | None
track_id: str | None
updated_at: datetime | None
class chariot.tracker.models.Tracker(*, tracker_id: str, name: str, kind: TrackerKind, max_missing_updates: int, min_lifetime_before_active: int, assignment_function: TrackerAssignmentFunction, assignment_threshold: float, label_behavior: TrackerLabelBehavior, state_transition: list[list[float]] | None = None, process_noise_covariance: list[list[float]] | None = None)[source]

Bases: BaseModel

assignment_function: TrackerAssignmentFunction
assignment_threshold: float
kind: TrackerKind
label_behavior: TrackerLabelBehavior
max_missing_updates: int
min_lifetime_before_active: int
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
process_noise_covariance: list[list[float]] | None
state_transition: list[list[float]] | None
tracker_id: str
class chariot.tracker.models.TrackerAssignmentFunction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

EUCLIDEAN = 'euclidean'
HAVERSINE = 'haversine'
INTERSECTION_OVER_UNION = 'intersection_over_union'
MAHALANOBIS = 'mahalanobis'
class chariot.tracker.models.TrackerKind(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

BOX_LAT_LONG = 'box_latitude_longitude'
BOX_UNITLESS = 'box_unitless'
POINT_LAT_LONG = 'point_latitude_longitude'
POINT_UNITLESS = 'point_unitless'
POINT_UTM = 'point_utm'
class chariot.tracker.models.TrackerLabelBehavior(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

LAST = 'last'
MAJORITY = 'majority'
OMIT = 'omit'
class chariot.tracker.models.UTMPoint(*, label: str, score: float, covariance: list[list[float]] = <factory>, id: str, northing: float, easting: float, zone: str)[source]

Bases: Measurement

easting: float
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

northing: float
classmethod validate_covariance(v)[source]
zone: str
class chariot.tracker.models.UnitlessBox(*, label: str, score: float, covariance: list[list[float]] = <factory>, id: str, x: float, y: float, w: float, h: float)[source]

Bases: Measurement

h: float
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod validate_covariance(v)[source]
w: float
x: float
y: float
class chariot.tracker.models.UnitlessBoxLocalizationMetadata(*, image_width: int, image_height: int, platform_heading_angle: float, platform_pitch_angle: float, platform_roll_angle: float, sensor_relative_azimuth_angle: float, sensor_relative_elevation_angle: float, sensor_relative_roll_angle: float, sensor_horizontal_field_of_view: float, sensor_vertical_field_of_view: float, sensor_latitude: float, sensor_longitude: float, sensor_true_altitude: float)[source]

Bases: BaseModel

image_height: int
image_width: int
model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

platform_heading_angle: float
platform_pitch_angle: float
platform_roll_angle: float
sensor_horizontal_field_of_view: float
sensor_latitude: float
sensor_longitude: float
sensor_relative_azimuth_angle: float
sensor_relative_elevation_angle: float
sensor_relative_roll_angle: float
sensor_true_altitude: float
sensor_vertical_field_of_view: float
class chariot.tracker.models.UnitlessPoint(*, label: str, score: float, covariance: list[list[float]] = <factory>, id: str, x: float, y: float)[source]

Bases: Measurement

model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod validate_covariance(v)[source]
x: float
y: float

chariot.tracker.tracker module

chariot.tracker.tracker.create_tracker(request_body: NewCreateTrackerRequest) Tracker | None[source]

Create a new tracker.

Parameters:

request_body (NewCreateTrackerRequest) – The create tracker specification.

Returns:

The tracker.

Return type:

Optional[models.Tracker]

chariot.tracker.tracker.delete_tracker(tracker_id: str)[source]

Delete an existing tracker.

Parameters:

tracker_id (str) – The tracker id.

chariot.tracker.tracker.get_tracker(tracker_id: str) Tracker | None[source]

Get an existing tracker.

Parameters:

tracker_id (str) – The tracker id.

Returns:

The tracker.

Return type:

Optional[models.Tracker]

chariot.tracker.tracker.get_trackers(project_id: str, name: str | None = None, fuzzy_name: str | None = None, sort: str = 'created_at:desc', offset: int = 0, limit: int = 10) list[Tracker][source]

Get existing trackers.

Parameters:
  • project_id (str) – The project id

  • name (str) – The exact name of the tracker.

  • fuzzy_name (str) – Search for trackers given a fuzzy name.

  • sort (str) – The column and direction to sort by (defaults to created_at:desc).

  • limit (int) – Limit the number of trackers returned (defaults to 10).

  • offset (int) – Offset the starting position of trackers to be returned (defaults to 0).

Returns:

The trackers.

Return type:

list[models.Tracker]

chariot.tracker.tracker.update_tracker(request_body: NewUpdateTrackerRequest) NewStoreTracksRequest | None[source]

Update an existing tracker and optionally wait for the track output.

If wait_for_output is False, this function always returns None. Otherwise, a successful update (HTTP 200) returns a NewStoreTracksRequest. To ensure synchronous behavior within the tracking service, the API handler for updates must wait for the track output message to be published and received.

The time required to process an update and receive the output can vary. If the wait_time expires before the output is received, a REQUEST_TIMEOUT (408) status is returned. This does not indicate that the tracker update failed, only that the output could not be delivered within the wait_time window.

The tracks should always be available within the inference-store.

Parameters:

request_body (NewUpdateTrackerRequest) – The update tracker specification.

Returns:

The track outputs.

Return type:

Optional[models.NewStoreTracksRequest]

Module contents