dgs.models.dataset.MOT.load_MOT_file

dgs.models.dataset.MOT.load_MOT_file(fp: str, *, sep: str = ',\\s?', device: torch.types.Device | str = 'cpu', seqinfo_fp: str | None = None, seqinfo_key: str | None = None, crop_key: str | None = None) tuple[list[State], dict[str, any]][source]

Given the path to a file in the MOT format, get a list of states. Each State contains the data of one image and the respective detections.

The MOT-files contain one annotation per line, each consisting of the values for: <frame>, <person_id>, <bb_left>, <bb_top>, <bb_width>, <bb_height>, <conf>, <x>, <y>, <z>

Notes

The world coordinates x,y,z are ignored for the 2D challenge and can be filled with -1 or 1. Similarly, the bounding boxes are ignored for the 3D challenge. However, each line is still required to contain exactly 10 values.

Notes

It seems that the value for <conf> is not always present.

Notes

All frame numbers, target IDs and bounding boxes are 1-based.

Parameters:
  • fp – The local or absolute path to the file containing the ground-truth information.

  • sep – The separator used between every value in every line. The separator can contain regex expressions.

  • device – The device the tensors of the State are on. Default “cpu”.

  • seqinfo_fp – The local or absolute path to the folder containing the seqinfo file for this dataset. With the default None, and with fp=".../MOT20-XX/gt/gt.txt", the file is expected to be in .../MOT20-XX/seqinfo.ini.

  • seqinfo_key – The key to use in the seqinfo file. Default DEF_VAL["submission"]["MOT"]["seqinfo_key"].

  • crop_key – The key to use in the seqinfo file when loading the image crop paths. Default DEF_VAL["submission"]["MOT"]["crop_key"].

Raises:

InvalidPathException if the file ending is not correct.

Returns:

A list containing one State per image, each State containing the respective annotations of the image.