ValidVIATracksCSV#

class movement.validators.files.ValidVIATracksCSV(file, frame_regexp='(0\\\\d*)\\\\.\\\\w+$')[source]#

Bases: object

Class for validating VIA tracks .csv files.

The validator ensures that the file:

  • contains the expected header,

  • contains valid frame numbers,

  • contains tracked bounding boxes, and

  • defines bounding boxes whose IDs are unique per image file.

If the file is validated, the bounding boxes data is pre-parsed from the input file and added as attributes.

Raises:

ValueError – If the file does not match the VIA tracks .csv file requirements.

confidence: ndarray[tuple[Any, ...], dtype[float32]]#

Array of confidence values of the tracked bounding boxes.

file: Path#

Path to the VIA tracks .csv file to validate.

frame_numbers: ndarray[tuple[Any, ...], dtype[int64]]#

Array of frame numbers corresponding to the tracked bounding boxes.

frame_regexp: str#

Regular expression pattern to extract the frame number from the filename. By default, the frame number is expected to be encoded in the filename as an integer number led by at least one zero, followed by the file extension.

h: ndarray[tuple[Any, ...], dtype[float32]]#

Array of height coordinates of the tracked bounding boxes.

ids: ndarray[tuple[Any, ...], dtype[int32]]#

Array of track IDs of the tracked bounding boxes.

suffixes: ClassVar[set[str]] = {'.csv'}#

Expected suffix(es) for the file.

w: ndarray[tuple[Any, ...], dtype[float32]]#

Array of width coordinates of the tracked bounding boxes.

x: ndarray[tuple[Any, ...], dtype[float32]]#

Array of x coordinates of the tracked bounding boxes.

y: ndarray[tuple[Any, ...], dtype[float32]]#

Array of y coordinates of the tracked bounding boxes.