problems.mot.dataset

Default datasets for the re-identification.

This submodule provides a small collection of built-in datasets that can be used out of the box for experimentation, testing, and demonstration purposes. The datasets are packaged within the library and require no additional downloads.

Typical usage is through the load_dataset() helper, which returns a preconfigured detection sequence ready for use in MOT pipelines.

>>> from tno.quantum.problems.mot.dataset import load_dataset
>>> det_sequence = load_dataset()
tno.quantum.problems.mot.dataset.load_dataset(path=None)[source]

Helper function to load a detection sequence dataset for MOT.

If a path is provided, the dataset is loaded from that file. Otherwise, the default built-in benchmark dataset is used.

Parameters:

path (Path | None) – Path to a JSON file containing the detection sequence. If not provided, the default built-in dataset is loaded.

Return type:

DetectionSequence

Returns:

The detection sequence ready to use in MOT pipelines.

Raises:

FileNotFoundError – If the test dataset can not be found.

tno.quantum.problems.mot.dataset.make_gif_with_detections(detections, input_filename, output_filename, fps=50, first_frame=0)[source]

Draws the detection boxes over the frames of the original videos.

Each ID is shown in a different color. If the detection sequence does not span the whole input video, the first and last frames need to be specified.

Parameters:
  • detections (DetectionSequence) – the detection sequence

  • input_filename (str) – name of the input video file

  • output_filename (str) – name of the output gif

  • fps (int) – frames per second of the output gif

  • first_frame (int) – frame number corresponding to detections[0].

Return type:

None

tno.quantum.problems.mot.dataset.make_video_with_detections(detections, input_filename, output_filename, fps=50, first_frame=0)[source]

Draws the detection boxes over the frames of the original videos.

Each ID is shown in a different color. If the detection sequence does not span the whole input video, the first and last frames need to be specified.

Parameters:
  • detections (DetectionSequence) – the detection sequence

  • input_filename (str) – name of the input video file

  • output_filename (str) – name of the output video file

  • fps (int) – frames per second of the output video

  • first_frame (int) – frame number corresponding to detections[0].

Return type:

None