Commit 1127bdd3 authored by Qizhu Li's avatar Qizhu Li Committed by Francisco Massa

Renames the `transforms` attribute of COCODataset (#744)

Avoids naming clash with torchvision CocoDetection class
parent eb4d3352
......@@ -61,7 +61,7 @@ class COCODataset(torchvision.datasets.coco.CocoDetection):
v: k for k, v in self.json_category_id_to_contiguous_id.items()
}
self.id_to_img_map = {k: v for k, v in enumerate(self.ids)}
self.transforms = transforms
self._transforms = transforms
def __getitem__(self, idx):
img, anno = super(COCODataset, self).__getitem__(idx)
......@@ -90,8 +90,8 @@ class COCODataset(torchvision.datasets.coco.CocoDetection):
target = target.clip_to_image(remove_empty=True)
if self.transforms is not None:
img, target = self.transforms(img, target)
if self._transforms is not None:
img, target = self._transforms(img, target)
return img, target, idx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment