MultiviewHeatmapDataset

class lightning_pose.data.datasets.MultiviewHeatmapDataset(root_directory: str, csv_paths: List[str], view_names: List[str], header_rows: List[int] | None = [0, 1, 2], downsample_factor: Literal[1, 2, 3] = 2, uniform_heatmaps: bool = False, do_context: bool = False, imgaug_transform: Callable | None = None)[source]

Bases: Dataset

Heatmap dataset that contains the images and keypoints in 2D arrays from all the cameras.

Attributes Summary

height

num_views

output_shape

width

Methods Summary

check_data_images_names()

Data checking Each object in self.datasets will have the attribute image_names (i.e.

fusion(datadict)

Merge images, heatmaps, keypoints, and bboxes across views.

Attributes Documentation

height
num_views
output_shape
width

Methods Documentation

check_data_images_names()[source]

Data checking Each object in self.datasets will have the attribute image_names (i.e. self.datasets[‘top’].image_names) since each values is a HeatmapDataset. Include a check to make sure that the image names are the same across all views, so that when it loads element n from each individual view we know these are properly matched.

fusion(datadict: dict) Tuple[Tensor[Tensor] | Tensor[Tensor], Tensor[Tensor], Tensor[Tensor], Tensor[Tensor], List][source]

Merge images, heatmaps, keypoints, and bboxes across views.

Parameters:

datadict – this comes from HeatmapDataset.__getItems__(idx) for each view.

Returns:

tuple
  • images

  • keypoints

  • heatmaps

  • bboxes

  • concat order