Commit dda734a4 authored by Debojeet Chatterjee's avatar Debojeet Chatterjee Committed by Facebook GitHub Bot
Browse files

INPUT.CROP=ENABLED silently fails when annotations dict is present but empty.

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/658

D2Go's INPUT.CROP=ENABLED silently fails when annotations dict is present but empty.
Ends up not using the dataset at all.

Adding an additional check to circumvent this failure.

Reviewed By: ayushidalmia

Differential Revision: D55640142

fbshipit-source-id: b733b841edb17c16d69332795c89c32b008cb6e5
parent b14282fb
......@@ -94,7 +94,7 @@ class D2GoDatasetMapper(object):
image, dataset_dict = self._custom_transform(image, dataset_dict)
inputs = AugInput(image=image)
if "annotations" not in dataset_dict:
if "annotations" not in dataset_dict or dataset_dict["annotations"] == []:
transforms = AugmentationList(
([self.crop_gen] if self.crop_gen else []) + self.tfm_gens
)(inputs)
......
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