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
8fe6e45a
Commit
8fe6e45a
authored
Feb 28, 2017
by
NC Cullen
Committed by
Soumith Chintala
Feb 28, 2017
Browse files
recursive dir walking (#80)
parent
c0a6cfe1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
torchvision/datasets/folder.py
torchvision/datasets/folder.py
+6
-5
No files found.
torchvision/datasets/folder.py
View file @
8fe6e45a
...
@@ -28,11 +28,12 @@ def make_dataset(dir, class_to_idx):
...
@@ -28,11 +28,12 @@ def make_dataset(dir, class_to_idx):
if
not
os
.
path
.
isdir
(
d
):
if
not
os
.
path
.
isdir
(
d
):
continue
continue
for
filename
in
os
.
listdir
(
d
):
for
root
,
_
,
fnames
in
sorted
(
os
.
walk
(
d
)):
if
is_image_file
(
filename
):
for
fname
in
fnames
:
path
=
'{0}/{1}'
.
format
(
target
,
filename
)
if
is_image_file
(
fname
):
item
=
(
path
,
class_to_idx
[
target
])
path
=
os
.
path
.
join
(
root
,
fname
)
images
.
append
(
item
)
item
=
(
path
,
class_to_idx
[
target
])
images
.
append
(
item
)
return
images
return
images
...
...
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