mmlearn.datasets.nihcxr

NIH Chest X-ray Dataset.

Classes

NIHCXR

NIH Chest X-ray dataset.

class NIHCXR(root_dir, split, transform=None)[source]

NIH Chest X-ray dataset.

Parameters:
  • root_dir (str) – Directory which contains .json files stating all dataset entries.

  • split ({"train", "test", "bbox"}) – Dataset split. “bbox” is a subset of “test” which contains bounding box info.

  • transform (Optional[Callable[[PIL.Image], torch.Tensor]], optional, default=None) – A callable that takes in a PIL image and returns a transformed version of the image as a PyTorch tensor.

__getitem__(idx)[source]

Return image-label or image-label-tabular(bbox).

Return type:

Example

__len__()[source]

Return the length of the dataset.

Return type:

int