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
e893959e
Commit
e893959e
authored
Jul 22, 2019
by
Philip Meier
Committed by
Soumith Chintala
Jul 22, 2019
Browse files
bug fixes (#1149)
parent
c187c2b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
torchvision/datasets/imagenet.py
torchvision/datasets/imagenet.py
+3
-4
No files found.
torchvision/datasets/imagenet.py
View file @
e893959e
...
...
@@ -38,7 +38,7 @@ class ImageNet(ImageFolder):
loader (callable, optional): A function to load an image given its path.
Attributes:
classes (list): List of the class names.
classes (list): List of the class name
tuple
s.
class_to_idx (dict): Dict with items (class_name, class_index).
wnids (list): List of the WordNet IDs.
wnid_to_idx (dict): Dict with items (wordnet_id, class_index).
...
...
@@ -57,12 +57,11 @@ class ImageNet(ImageFolder):
super
(
ImageNet
,
self
).
__init__
(
self
.
split_folder
,
**
kwargs
)
self
.
root
=
root
idcs
=
[
idx
for
_
,
idx
in
self
.
imgs
]
self
.
wnids
=
self
.
classes
self
.
wnid_to_idx
=
{
wnid
:
idx
for
idx
,
wnid
in
zip
(
idcs
,
self
.
wnids
)}
self
.
wnid_to_idx
=
self
.
class_to_idx
self
.
classes
=
[
wnid_to_classes
[
wnid
]
for
wnid
in
self
.
wnids
]
self
.
class_to_idx
=
{
cls
:
idx
for
clss
,
idx
in
zip
(
self
.
classes
,
idcs
)
for
idx
,
clss
in
enumerate
(
self
.
classes
)
for
cls
in
clss
}
def
download
(
self
):
...
...
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