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
5bc68cc9
"doc/git@developer.sourcefind.cn:OpenDAS/ktransformers.git" did not exist on "74bb7fdcf66098bf26f35486f2674cfa0faec586"
Unverified
Commit
5bc68cc9
authored
Apr 26, 2021
by
Prabhat Roy
Committed by
GitHub
Apr 26, 2021
Browse files
Cleaned-up imports in test files related to datasets (#3720)
parent
eda94356
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
37 deletions
+20
-37
test/datasets_utils.py
test/datasets_utils.py
+0
-2
test/fakedata_generation.py
test/fakedata_generation.py
+7
-9
test/test_datasets.py
test/test_datasets.py
+13
-26
No files found.
test/datasets_utils.py
View file @
5bc68cc9
import
collections.abc
import
contextlib
import
contextlib
import
functools
import
functools
import
importlib
import
importlib
...
@@ -15,7 +14,6 @@ from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Tupl
...
@@ -15,7 +14,6 @@ from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Tupl
import
PIL
import
PIL
import
PIL.Image
import
PIL.Image
import
torch
import
torch
import
torchvision.datasets
import
torchvision.datasets
import
torchvision.io
import
torchvision.io
...
...
test/fakedata_generation.py
View file @
5bc68cc9
import
os
import
os
import
contextlib
import
contextlib
import
hashlib
import
pickle
import
re
import
tarfile
import
tarfile
import
json
import
unittest.mock
from
distutils
import
dir_util
import
numpy
as
np
import
numpy
as
np
import
PIL
import
PIL
import
torch
import
torch
from
common_utils
import
get_tmp_dir
from
common_utils
import
get_tmp_dir
import
pickle
import
random
from
itertools
import
cycle
from
torchvision.io.video
import
write_video
import
unittest.mock
import
hashlib
from
distutils
import
dir_util
import
re
def
mock_class_attribute
(
stack
,
target
,
new
):
def
mock_class_attribute
(
stack
,
target
,
new
):
...
...
test/test_datasets.py
View file @
5bc68cc9
import
bz2
import
contextlib
import
contextlib
import
sys
import
io
import
os
import
unittest
import
numpy
as
np
import
PIL
from
PIL
import
Image
from
torch._utils_internal
import
get_file_path_2
import
torchvision
from
torchvision.datasets
import
utils
from
common_utils
import
get_tmp_dir
import
xml.etree.ElementTree
as
ET
from
urllib.request
import
Request
,
urlopen
import
itertools
import
itertools
import
datasets_util
s
import
o
s
import
pathlib
import
pathlib
import
pickle
import
pickle
from
torchvision
import
datasets
import
torch
import
shutil
import
json
import
json
import
random
import
random
import
bz2
import
shutil
import
torch.nn.functional
as
F
import
string
import
string
import
io
import
unittest
import
xml.etree.ElementTree
as
ET
import
zipfile
import
zipfile
import
PIL
import
datasets_utils
import
numpy
as
np
import
torch
import
torch.nn.functional
as
F
from
torchvision
import
datasets
try
:
try
:
import
scipy
import
scipy
...
@@ -33,12 +26,6 @@ try:
...
@@ -33,12 +26,6 @@ try:
except
ImportError
:
except
ImportError
:
HAS_SCIPY
=
False
HAS_SCIPY
=
False
try
:
import
av
HAS_PYAV
=
True
except
ImportError
:
HAS_PYAV
=
False
class
STL10TestCase
(
datasets_utils
.
ImageDatasetTestCase
):
class
STL10TestCase
(
datasets_utils
.
ImageDatasetTestCase
):
DATASET_CLASS
=
datasets
.
STL10
DATASET_CLASS
=
datasets
.
STL10
...
@@ -946,7 +933,7 @@ class LSUNTestCase(datasets_utils.ImageDatasetTestCase):
...
@@ -946,7 +933,7 @@ class LSUNTestCase(datasets_utils.ImageDatasetTestCase):
key
=
""
.
join
(
random
.
choice
(
hexdigits_lowercase
)
for
_
in
range
(
40
)).
encode
()
key
=
""
.
join
(
random
.
choice
(
hexdigits_lowercase
)
for
_
in
range
(
40
)).
encode
()
buffer
=
io
.
BytesIO
()
buffer
=
io
.
BytesIO
()
Image
.
open
(
file
).
save
(
buffer
,
format
)
PIL
.
Image
.
open
(
file
).
save
(
buffer
,
format
)
buffer
.
seek
(
0
)
buffer
.
seek
(
0
)
value
=
buffer
.
read
()
value
=
buffer
.
read
()
...
...
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