mmlearn.datasets.chexpert

CheXpert Dataset.

Classes

CheXpert

CheXpert dataset.

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

CheXpert dataset.

Each datapoint is a pair of (image, target label).

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

  • split ({"train", "valid"}) – Dataset split.

  • labeler (Optional[{"chexpert", "chexbert", "vchexbert"}], optional, default=None) – Labeler used to extract labels from the training images. “valid” split has no labeler, labeling for valid split was done by human radiologists.

  • 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 the idx’th datapoint.

Return type:

Example

__len__()[source]

Return the length of the dataset.

Return type:

int