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
2c4e68e4
Commit
2c4e68e4
authored
Apr 25, 2019
by
Philip Meier
Committed by
Francisco Massa
Apr 25, 2019
Browse files
removed md5 checking from meta file (#870)
parent
6716fc51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
torchvision/datasets/imagenet.py
torchvision/datasets/imagenet.py
+3
-11
No files found.
torchvision/datasets/imagenet.py
View file @
2c4e68e4
...
@@ -20,11 +20,6 @@ ARCHIVE_DICT = {
...
@@ -20,11 +20,6 @@ ARCHIVE_DICT = {
}
}
}
}
META_DICT
=
{
'filename'
:
'meta.bin'
,
'md5'
:
'7e0d3cf156177e4fc47011cdd30ce706'
,
}
class
ImageNet
(
ImageFolder
):
class
ImageNet
(
ImageFolder
):
"""`ImageNet <http://image-net.org/>`_ 2012 Classification Dataset.
"""`ImageNet <http://image-net.org/>`_ 2012 Classification Dataset.
...
@@ -70,7 +65,7 @@ class ImageNet(ImageFolder):
...
@@ -70,7 +65,7 @@ class ImageNet(ImageFolder):
for
cls
in
clss
}
for
cls
in
clss
}
def
download
(
self
):
def
download
(
self
):
if
not
self
.
_check_meta_file_integrity
(
):
if
not
check_integrity
(
self
.
meta_file
):
tmpdir
=
os
.
path
.
join
(
self
.
root
,
'tmp'
)
tmpdir
=
os
.
path
.
join
(
self
.
root
,
'tmp'
)
archive_dict
=
ARCHIVE_DICT
[
'devkit'
]
archive_dict
=
ARCHIVE_DICT
[
'devkit'
]
...
@@ -102,13 +97,10 @@ class ImageNet(ImageFolder):
...
@@ -102,13 +97,10 @@ class ImageNet(ImageFolder):
@
property
@
property
def
meta_file
(
self
):
def
meta_file
(
self
):
return
os
.
path
.
join
(
self
.
root
,
META_DICT
[
'filename'
])
return
os
.
path
.
join
(
self
.
root
,
'meta.bin'
)
def
_check_meta_file_integrity
(
self
):
return
check_integrity
(
self
.
meta_file
,
META_DICT
[
'md5'
])
def
_load_meta_file
(
self
):
def
_load_meta_file
(
self
):
if
self
.
_check_meta_file_integrity
(
):
if
check_integrity
(
self
.
meta_file
):
return
torch
.
load
(
self
.
meta_file
)
return
torch
.
load
(
self
.
meta_file
)
else
:
else
:
raise
RuntimeError
(
"Meta file not found or corrupted."
,
raise
RuntimeError
(
"Meta file not found or corrupted."
,
...
...
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