def _load_data(data_dir: Path) -> Tuple[torch.Tensor, Iterable, Iterable]:
        """Load data from directory.

        Parse names of images to get person ids as labels and camera ids.

        Args:
            data_dir: path to directory that contains data

        Returns:
            images, their labels and ids of the cameras that made the photos
        """
        # Gallery dataset contains good, junk and distractor images;
        # junk ones (marked as -1) should be neglected during evaluation.
        filenames = list(data_dir.glob("[!-]*.jpg"))
        data = torch.from_numpy(
            np.array([imread(filename) for filename in filenames])
        ).float()
        pids = np.array([int(filename.name.split("_")[0]) for filename in filenames])
        cids = np.array(
            [int(filename.name.split("_")[1][1:2]) for filename in filenames]
        )
        return data, pids, cids
Load data from directory.

        Parse names of images to get person ids as labels and camera ids.

        Args:
            data_dir: path to directory that contains data

        Returns:
            images, their labels and ids of the cameras that made the photos
        
catalyst/contrib/datasets/market1501.py