CocoDetection
accepts slice
as argument to its __getitem__
and returns wrong result
#7824
Labels
Hi, although
CocoDetection
declares its__getitem__
argument to be of typeint
, it actually acceptsslice
as well. However it returns a wrong result. As this might be confusing for some users, I suggest to add a type check at the beginning of the__getitem__
.vision/torchvision/datasets/coco.py
Lines 46 to 49 in cab01fc
The image in the returned tuple is that of the
ds[0]
and the target is the combined annotations ofds[0]
andds[1]
which is wrong. This is due to the fact thatds.coco
could work with a list of inputs in itsgetAnnIds()
.cc @pmeier
The text was updated successfully, but these errors were encountered: