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¶
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_IDif the track ID was not found.
get_re_id_state¶
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_SETwhen the clock time has not been set, orCAMERA_NAME_NOT_SETwhen the unique camera name has not been set.
merge_re_id_state¶
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:
- state: The data to merge, as obtained from
get_re_id_state.
Returns:
- Returns
SUCCESSon success,TIME_NOT_SETwhen the clock time has not been set,STATE_CORRUPTwhen the state was corrupted, orSTATE_SETTINGS_MISMATCHwhen the state was created with an incompatible version of the software.
is_available¶
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
Trueif the functionality of ReIdentification is available.