vis4d.state.track.qdtrack

Memory for QDTrack inference.

Classes

QDTrackGraph([track, memory_size, ...])

Quasi-dense embedding similarity based graph.

Track

QDTrack Track state.

class QDTrackGraph(track=None, memory_size=10, memory_momentum=0.8, nms_backdrop_iou_thr=0.3, backdrop_memory_size=1)[source]

Quasi-dense embedding similarity based graph.

Init.

__call__(embeddings_list, det_boxes_list, det_scores_list, class_ids_list, frame_id_list)[source]

Forward during test.

Return type:

TrackOut

create_track(track_id, box, score, class_id, embedding, frame_id)[source]

Create a new track from a models.

Return type:

None

get_tracks(device, frame_id=None, add_backdrops=False)[source]

Get tracklests.

If the frame_id is not provided, will return the latest state of all tracklets. Otherwise, will return the state of all tracklets at the given frame_id. If add_backdrops is True, will also return the backdrops.

Parameters:
  • device (torch.device) – Device to put the tensors on.

  • frame_id (int, optional) – Frame id to query. Defaults to None.

  • add_backdrops (bool, optional) – Whether to add backdrops to the output. Defaults to False.

Returns:

2D boxes in shape (N, 4). scores (Tensor): 2D scores in shape (N,). class_ids (Tensor): Class ids in shape (N,). track_ids (Tensor): Track ids in shape (N,). embeddings (Tensor): Embeddings in shape (N, E).

Return type:

boxes (Tensor)

is_empty()[source]

Check if the memory is empty.

Return type:

bool

reset()[source]

Empty the memory.

Return type:

None

update(frame_id, track_ids, boxes, scores, class_ids, embeddings)[source]

Update the track memory with a new state.

Return type:

None

update_track(track_id, box, score, class_id, embedding, frame_id)[source]

Update a specific track with a new models.

Return type:

None

class Track[source]

QDTrack Track state.

box

In shape (4,) and contains x1, y1, x2, y2.

Type:

Tensor

score

In shape (1,).

Type:

Tensor

class_id

In shape (1,).

Type:

Tensor

embedding

In shape (E,). E is the embedding dimension.

Type:

Tensor

last_frame

Last frame id.

Type:

int