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
c399c3f4
Unverified
Commit
c399c3f4
authored
Apr 11, 2022
by
Philip Meier
Committed by
GitHub
Apr 11, 2022
Browse files
add background category to prototype VOC dataset (#5687)
parent
9a9ae1ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
torchvision/prototype/datasets/_builtin/voc.categories
torchvision/prototype/datasets/_builtin/voc.categories
+1
-0
torchvision/prototype/datasets/_builtin/voc.py
torchvision/prototype/datasets/_builtin/voc.py
+5
-1
No files found.
torchvision/prototype/datasets/_builtin/voc.categories
View file @
c399c3f4
__background__
aeroplane
bicycle
bird
...
...
torchvision/prototype/datasets/_builtin/voc.py
View file @
c399c3f4
...
...
@@ -219,4 +219,8 @@ class VOC(Dataset):
dp
=
Filter
(
archive_dp
,
self
.
_filter_anns
)
dp
=
Mapper
(
dp
,
self
.
_parse_detection_ann
,
input_col
=
1
)
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"
]})
# We add a background category to be used during segmentation
categories
.
insert
(
0
,
"__background__"
)
return
categories
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