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
a00c905d
Unverified
Commit
a00c905d
authored
Oct 31, 2021
by
Philip Meier
Committed by
GitHub
Oct 31, 2021
Browse files
add val split and year 2017 to prototype coco (#4807)
parent
f63f4658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
19 deletions
+26
-19
torchvision/prototype/datasets/_builtin/coco.py
torchvision/prototype/datasets/_builtin/coco.py
+26
-19
No files found.
torchvision/prototype/datasets/_builtin/coco.py
View file @
a00c905d
...
@@ -41,29 +41,36 @@ class Coco(Dataset):
...
@@ -41,29 +41,36 @@ class Coco(Dataset):
type
=
DatasetType
.
IMAGE
,
type
=
DatasetType
.
IMAGE
,
homepage
=
"https://cocodataset.org/"
,
homepage
=
"https://cocodataset.org/"
,
valid_options
=
dict
(
valid_options
=
dict
(
split
=
(
"train"
,),
split
=
(
"train"
,
"val"
),
year
=
(
"2014"
,),
year
=
(
"2014"
,
"2017"
),
),
),
)
)
_IMAGE_URL_BASE
=
"http://images.cocodataset.org/zips"
_IMAGES_CHECKSUMS
=
{
(
"2014"
,
"train"
):
"ede4087e640bddba550e090eae701092534b554b42b05ac33f0300b984b31775"
,
(
"2014"
,
"val"
):
"fe9be816052049c34717e077d9e34aa60814a55679f804cd043e3cbee3b9fde0"
,
(
"2017"
,
"train"
):
"69a8bb58ea5f8f99d24875f21416de2e9ded3178e903f1f7603e283b9e06d929"
,
(
"2017"
,
"val"
):
"4f7e2ccb2866ec5041993c9cf2a952bbed69647b115d0f74da7ce8f4bef82f05"
,
}
_META_URL_BASE
=
"http://images.cocodataset.org/annotations"
_META_CHECKSUMS
=
{
"2014"
:
"031296bbc80c45a1d1f76bf9a90ead27e94e99ec629208449507a4917a3bf009"
,
"2017"
:
"113a836d90195ee1f884e704da6304dfaaecff1f023f49b6ca93c4aaae470268"
,
}
def
resources
(
self
,
config
:
DatasetConfig
)
->
List
[
OnlineResource
]:
def
resources
(
self
,
config
:
DatasetConfig
)
->
List
[
OnlineResource
]:
if
config
.
year
==
"2014"
:
images
=
HttpResource
(
if
config
.
split
in
(
"train"
,
"val"
):
f
"
{
self
.
_IMAGE_URL_BASE
}
/
{
config
.
split
}{
config
.
year
}
.zip"
,
if
config
.
split
==
"train"
:
sha256
=
self
.
_IMAGES_CHECKSUMS
[(
config
.
year
,
config
.
split
)],
images
=
HttpResource
(
)
"http://images.cocodataset.org/zips/train2014.zip"
,
meta
=
HttpResource
(
sha256
=
"ede4087e640bddba550e090eae701092534b554b42b05ac33f0300b984b31775"
,
f
"
{
self
.
_META_URL_BASE
}
/annotations_trainval
{
config
.
year
}
.zip"
,
)
sha256
=
self
.
_META_CHECKSUMS
[
config
.
year
],
else
:
)
raise
RuntimeError
(
"FIXME"
)
meta
=
HttpResource
(
"http://images.cocodataset.org/annotations/annotations_trainval2014.zip"
,
sha256
=
"031296bbc80c45a1d1f76bf9a90ead27e94e99ec629208449507a4917a3bf009"
,
)
else
:
raise
RuntimeError
(
"FIXME"
)
else
:
raise
RuntimeError
(
"FIXME"
)
return
[
images
,
meta
]
return
[
images
,
meta
]
def
_classify_meta
(
self
,
data
:
Tuple
[
str
,
Any
])
->
Optional
[
int
]:
def
_classify_meta
(
self
,
data
:
Tuple
[
str
,
Any
])
->
Optional
[
int
]:
...
...
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