Unverified Commit 29757104 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

add image_id to the default return for wrapped CocoDetection (#7511)

parent 5b07d6c9
...@@ -38,8 +38,8 @@ def wrap_dataset_for_transforms_v2(dataset, target_keys=None): ...@@ -38,8 +38,8 @@ def wrap_dataset_for_transforms_v2(dataset, target_keys=None):
* :class:`~torchvision.datasets.CocoDetection`: Instead of returning the target as list of dicts, the wrapper * :class:`~torchvision.datasets.CocoDetection`: Instead of returning the target as list of dicts, the wrapper
returns a dict of lists. In addition, the key-value-pairs ``"boxes"`` (in ``XYXY`` coordinate format), returns a dict of lists. In addition, the key-value-pairs ``"boxes"`` (in ``XYXY`` coordinate format),
``"masks"`` and ``"labels"`` are added and wrap the data in the corresponding ``torchvision.datapoints``. ``"masks"`` and ``"labels"`` are added and wrap the data in the corresponding ``torchvision.datapoints``.
The original keys are preserved. If ``target_keys`` is ommitted, returns only the values for the ``"boxes"`` The original keys are preserved. If ``target_keys`` is ommitted, returns only the values for the
and ``"labels"``. ``"image_id"``, ``"boxes"``, and ``"labels"``.
* :class:`~torchvision.datasets.VOCDetection`: The key-value-pairs ``"boxes"`` and ``"labels"`` are added to * :class:`~torchvision.datasets.VOCDetection`: The key-value-pairs ``"boxes"`` and ``"labels"`` are added to
the target and wrap the data in the corresponding ``torchvision.datapoints``. The original keys are the target and wrap the data in the corresponding ``torchvision.datapoints``. The original keys are
preserved. If ``target_keys`` is ommitted, returns only the values for the ``"boxes"`` and ``"labels"``. preserved. If ``target_keys`` is ommitted, returns only the values for the ``"boxes"`` and ``"labels"``.
...@@ -328,7 +328,7 @@ def coco_dectection_wrapper_factory(dataset, target_keys): ...@@ -328,7 +328,7 @@ def coco_dectection_wrapper_factory(dataset, target_keys):
"masks", "masks",
"labels", "labels",
}, },
default={"boxes", "labels"}, default={"image_id", "boxes", "labels"},
) )
def segmentation_to_mask(segmentation, *, spatial_size): def segmentation_to_mask(segmentation, *, spatial_size):
......
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