Shortcuts

PILToNumpy

class mmpretrain.datasets.transforms.PILToNumpy(to_bgr=False, dtype=None)[source]

Convert img to numpy.ndarray.

Required Keys:

  • img

Modified Keys:

  • img

Parameters:
  • to_bgr (bool) – Whether to convert img to rgb. Defaults to True.

  • dtype (str, optional) – The dtype of the converted numpy array. Defaults to None.

transform(results)[source]

Method to convert img to numpy.ndarray.