Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
29757104
Unverified
Commit
29757104
authored
Apr 13, 2023
by
Philip Meier
Committed by
GitHub
Apr 13, 2023
Browse files
add image_id to the default return for wrapped CocoDetection (#7511)
parent
5b07d6c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/datapoints/_dataset_wrapper.py
torchvision/datapoints/_dataset_wrapper.py
+3
-3
No files found.
torchvision/datapoints/_dataset_wrapper.py
View file @
29757104
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment