We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a9ae1e commit c399c3fCopy full SHA for c399c3f
torchvision/prototype/datasets/_builtin/voc.categories
@@ -1,3 +1,4 @@
1
+__background__
2
aeroplane
3
bicycle
4
bird
torchvision/prototype/datasets/_builtin/voc.py
@@ -219,4 +219,8 @@ def _generate_categories(self) -> List[str]:
219
dp = Filter(archive_dp, self._filter_anns)
220
dp = Mapper(dp, self._parse_detection_ann, input_col=1)
221
222
- return sorted({instance["name"] for _, anns in dp for instance in anns["object"]})
+ categories = sorted({instance["name"] for _, anns in dp for instance in anns["object"]})
223
+ # We add a background category to be used during segmentation
224
+ categories.insert(0, "__background__")
225
+
226
+ return categories
0 commit comments