def __init__(
        self,
        root: str,
        transform: Optional[Callable[[torch.Tensor], torch.Tensor]] = None,
    ):
        """
        Market1501 dataset for testing stage of reid task.

        Args:
            root: path to a directory that contains Market-1501-v15.09.15
            transform: transformation that should be applied to images
        """
        self.root = Path(root)
        self._gallery_dir = self.root / "Market-1501-v15.09.15/bounding_box_test"
        self._query_dir = self.root / "Market-1501-v15.09.15/query"
        self.transform = transform
        query_data, query_pids, query_cids = self._load_data(self._query_dir)
        gallery_data, gallery_pids, gallery_cids = self._load_data(self._gallery_dir)

        self._query_size = query_data.shape[0]
        self._gallery_size = gallery_data.shape[0]

        self.data = torch.cat([gallery_data, query_data])
        self.pids = np.concatenate([gallery_pids, query_pids])
        self.cids = np.concatenate([gallery_cids, query_cids])
        self._is_query = torch.cat(
            [
                torch.zeros(size=(self._gallery_size,)),
                torch.ones(size=(self._query_size,)),
            ]
        )

        Market1501 dataset for testing stage of reid task.

        Args:
            root: path to a directory that contains Market-1501-v15.09.15
            transform: transformation that should be applied to images
        
catalyst/contrib/datasets/market1501.py