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
c1f88ef1
Commit
c1f88ef1
authored
Jun 13, 2017
by
Ryuichiro Hataya
Committed by
Soumith Chintala
Jun 13, 2017
Browse files
enable ~ expression in datasets (#186)
parent
432aa00d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
6 deletions
+8
-6
torchvision/datasets/cifar.py
torchvision/datasets/cifar.py
+1
-1
torchvision/datasets/coco.py
torchvision/datasets/coco.py
+1
-1
torchvision/datasets/folder.py
torchvision/datasets/folder.py
+1
-0
torchvision/datasets/mnist.py
torchvision/datasets/mnist.py
+1
-1
torchvision/datasets/phototour.py
torchvision/datasets/phototour.py
+1
-1
torchvision/datasets/stl10.py
torchvision/datasets/stl10.py
+1
-1
torchvision/datasets/svhn.py
torchvision/datasets/svhn.py
+1
-1
torchvision/datasets/utils.py
torchvision/datasets/utils.py
+1
-0
No files found.
torchvision/datasets/cifar.py
View file @
c1f88ef1
...
@@ -50,7 +50,7 @@ class CIFAR10(data.Dataset):
...
@@ -50,7 +50,7 @@ class CIFAR10(data.Dataset):
def
__init__
(
self
,
root
,
train
=
True
,
def
__init__
(
self
,
root
,
train
=
True
,
transform
=
None
,
target_transform
=
None
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
download
=
False
):
self
.
root
=
root
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
transform
=
transform
self
.
transform
=
transform
self
.
target_transform
=
target_transform
self
.
target_transform
=
target_transform
self
.
train
=
train
# training set or test set
self
.
train
=
train
# training set or test set
...
...
torchvision/datasets/coco.py
View file @
c1f88ef1
...
@@ -44,7 +44,7 @@ class CocoCaptions(data.Dataset):
...
@@ -44,7 +44,7 @@ class CocoCaptions(data.Dataset):
"""
"""
def
__init__
(
self
,
root
,
annFile
,
transform
=
None
,
target_transform
=
None
):
def
__init__
(
self
,
root
,
annFile
,
transform
=
None
,
target_transform
=
None
):
from
pycocotools.coco
import
COCO
from
pycocotools.coco
import
COCO
self
.
root
=
root
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
coco
=
COCO
(
annFile
)
self
.
coco
=
COCO
(
annFile
)
self
.
ids
=
list
(
self
.
coco
.
imgs
.
keys
())
self
.
ids
=
list
(
self
.
coco
.
imgs
.
keys
())
self
.
transform
=
transform
self
.
transform
=
transform
...
...
torchvision/datasets/folder.py
View file @
c1f88ef1
...
@@ -23,6 +23,7 @@ def find_classes(dir):
...
@@ -23,6 +23,7 @@ def find_classes(dir):
def
make_dataset
(
dir
,
class_to_idx
):
def
make_dataset
(
dir
,
class_to_idx
):
images
=
[]
images
=
[]
dir
=
os
.
path
.
expanduser
(
dir
)
for
target
in
os
.
listdir
(
dir
):
for
target
in
os
.
listdir
(
dir
):
d
=
os
.
path
.
join
(
dir
,
target
)
d
=
os
.
path
.
join
(
dir
,
target
)
if
not
os
.
path
.
isdir
(
d
):
if
not
os
.
path
.
isdir
(
d
):
...
...
torchvision/datasets/mnist.py
View file @
c1f88ef1
...
@@ -36,7 +36,7 @@ class MNIST(data.Dataset):
...
@@ -36,7 +36,7 @@ class MNIST(data.Dataset):
test_file
=
'test.pt'
test_file
=
'test.pt'
def
__init__
(
self
,
root
,
train
=
True
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
def
__init__
(
self
,
root
,
train
=
True
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
self
.
root
=
root
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
transform
=
transform
self
.
transform
=
transform
self
.
target_transform
=
target_transform
self
.
target_transform
=
target_transform
self
.
train
=
train
# training set or test set
self
.
train
=
train
# training set or test set
...
...
torchvision/datasets/phototour.py
View file @
c1f88ef1
...
@@ -49,7 +49,7 @@ class PhotoTour(data.Dataset):
...
@@ -49,7 +49,7 @@ class PhotoTour(data.Dataset):
matches_files
=
'm50_100000_100000_0.txt'
matches_files
=
'm50_100000_100000_0.txt'
def
__init__
(
self
,
root
,
name
,
train
=
True
,
transform
=
None
,
download
=
False
):
def
__init__
(
self
,
root
,
name
,
train
=
True
,
transform
=
None
,
download
=
False
):
self
.
root
=
root
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
name
=
name
self
.
name
=
name
self
.
data_dir
=
os
.
path
.
join
(
root
,
name
)
self
.
data_dir
=
os
.
path
.
join
(
root
,
name
)
self
.
data_down
=
os
.
path
.
join
(
root
,
'{}.zip'
.
format
(
name
))
self
.
data_down
=
os
.
path
.
join
(
root
,
'{}.zip'
.
format
(
name
))
...
...
torchvision/datasets/stl10.py
View file @
c1f88ef1
...
@@ -44,7 +44,7 @@ class STL10(CIFAR10):
...
@@ -44,7 +44,7 @@ class STL10(CIFAR10):
def
__init__
(
self
,
root
,
split
=
'train'
,
def
__init__
(
self
,
root
,
split
=
'train'
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
transform
=
None
,
target_transform
=
None
,
download
=
False
):
self
.
root
=
root
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
transform
=
transform
self
.
transform
=
transform
self
.
target_transform
=
target_transform
self
.
target_transform
=
target_transform
self
.
split
=
split
# train/test/unlabeled set
self
.
split
=
split
# train/test/unlabeled set
...
...
torchvision/datasets/svhn.py
View file @
c1f88ef1
...
@@ -38,7 +38,7 @@ class SVHN(data.Dataset):
...
@@ -38,7 +38,7 @@ class SVHN(data.Dataset):
def
__init__
(
self
,
root
,
split
=
'train'
,
def
__init__
(
self
,
root
,
split
=
'train'
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
transform
=
None
,
target_transform
=
None
,
download
=
False
):
self
.
root
=
root
self
.
root
=
os
.
path
.
expanduser
(
root
)
self
.
transform
=
transform
self
.
transform
=
transform
self
.
target_transform
=
target_transform
self
.
target_transform
=
target_transform
self
.
split
=
split
# training set or test set or extra set
self
.
split
=
split
# training set or test set or extra set
...
...
torchvision/datasets/utils.py
View file @
c1f88ef1
...
@@ -21,6 +21,7 @@ def check_integrity(fpath, md5):
...
@@ -21,6 +21,7 @@ def check_integrity(fpath, md5):
def
download_url
(
url
,
root
,
filename
,
md5
):
def
download_url
(
url
,
root
,
filename
,
md5
):
from
six.moves
import
urllib
from
six.moves
import
urllib
root
=
os
.
path
.
expanduser
(
root
)
fpath
=
os
.
path
.
join
(
root
,
filename
)
fpath
=
os
.
path
.
join
(
root
,
filename
)
try
:
try
:
...
...
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