Skip to content

Plumerai Multi-Camera Re-Identification API

This page documents the API for the Multi-Camera Re-Identification (ReID) component.

For an overview of how to setup multi-camera synchronization, see the C++ documentation.

ReIdentification

get_matching_track_ids

ReIdentification.get_matching_track_ids(track_id: int) -> tuple[ErrorCode, list[int]]

Retrieve the matching track IDs of a given track ID.

If the track ID was not found or the class of the track does not have support for ReIdentification, INVALID_TRACK_ID is returned.

When the track is not (yet) matched to other tracks, a list with one track ID is returned (its own ID), with an error code SUCCESS.

When the track ID was matched to other track IDs, all known matching track IDs are returned in the list, with an error code SUCCESS.

Arguments:

  • track_id: A track ID, e.g. from BoxPrediction.track_id.

Returns:

  • A tuple of an error code and the list of matching track IDs. Returns INVALID_TRACK_ID if the track ID was not found.

get_re_id_state

ReIdentification.get_re_id_state() -> tuple[ErrorCode, bytes]

Get the current state of the ReIdentification algorithm.

This can be used to store the state to persistent storage when a device shuts down and restore it later when it reboots.

This function can only be called when the clock time has been set through VideoIntelligence.set_clock_time, and a unique camera name has been set through VideoIntelligence.set_camera_name.

Arguments:

  • None.

Returns:

  • A tuple of an error code and the serialized state as bytes. Returns TIME_NOT_SET when the clock time has not been set, or CAMERA_NAME_NOT_SET when the unique camera name has not been set.

merge_re_id_state

ReIdentification.merge_re_id_state(state: bytes) -> ErrorCode

Merge ReIdentification data into the current VideoIntelligence instance.

This can be used to restore a previous state from persistent storage, for example when a device reboots. When called with data obtained from a different instance of VideoIntelligence, for example from a different camera, this will merge the ReIdentification data from that instance into the current instance.

This function can only be called when the clock time has been set through VideoIntelligence.set_clock_time.

Arguments:

Returns:

  • Returns SUCCESS on success, TIME_NOT_SET when the clock time has not been set, STATE_CORRUPT when the state was corrupted, or STATE_SETTINGS_MISMATCH when the state was created with an incompatible version of the software.

is_available

ReIdentification.is_available() -> bool

Check if the ReIdentification algorithm functionality is available.

This function can be used to check if the library was built with support for ReIdentification. Note that ReIdentification is an optional product feature and requires a separate license.

Arguments:

  • None.

Returns:

  • Returns True if the functionality of ReIdentification is available.