BaseTrackingDatasetο
- class lightning_pose.data.datasets.BaseTrackingDataset[source]ο
Bases:
DatasetBase dataset that contains images and keypoints as (x, y) pairs.
Attributes Summary
Attributes Documentation
- heightο
- widthο
- __init__(root_directory: str, csv_path: str, image_resize_height: int, image_resize_width: int, header_rows: list[int] | None = [0, 1, 2], imgaug_transform: Callable | None = None, do_context: bool = False, resize: bool = True, bbox_path: str | None = None) None[source]ο
Initialize a dataset for regression (rather than heatmap) models.
The csv file of labels will be searched for in the following order: 1. assume csv is located at root_directory/csv_path (i.e. csv_path
argument is a path relative to root_directory)
- if not found, assume csv_path is absolute. Note the image paths
within the csv must still be relative to root_directory
if not found, assume dlc directory structure: root_directory/training-data/iteration-0/csv_path (csv_path argument will look like βCollectedData_<scorer>.csvβ)
- Parameters:
root_directory β path to data directory
csv_path β path to CSV file (within root_directory). CSV file should be in the form (image_path, bodypart_1_x, bodypart_1_y, β¦, bodypart_n_y) Note: image_path is relative to the given root_directory
resize_height β height to resize images before sending to network
resize_width β height to resize images before sending to network
header_rows β which rows in the csv are header rows
imgaug_transform β imgaug transform pipeline to apply to images
do_context β include additional frames of context if possible.
resize β True to add final resizing augmentation before sending data to network. This can be set to False if inheritors of this class need to implement more sophisticated augmentations before resizing (e.g. 3d augmentations). Note that when this is False, it is up to the child class to perform this resizing on both images and keypoints before returning a batch of data.
bbox_path β path to csv file that contains bounding box information; rows must be in same order as csv file
- __new__(**kwargs)ο