Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
BSH_Project3
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김재형
2021-05-06 18:44:35 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
72c238e70bdc0aa5a4921c5b5f072f72f7958357
72c238e7
1 parent
d3088d02
Fix dataset div2h5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
carn/dataset/div2h5.py
carn/dataset/div2h5.py
View file @
72c238e
import
os
import
glob
import
h5py
import
scipy.misc
as
misc
from
skimage
import
io
import
numpy
as
np
dataset_dir
=
"DIV2K/"
dataset_dir
=
"
/workspace/dataset/
DIV2K/"
dataset_type
=
"train"
f
=
h5py
.
File
(
"DIV2K_{}.h5"
.
format
(
dataset_type
),
"w"
)
dt
=
h5py
.
special_dtype
(
vlen
=
np
.
dtype
(
'uint8'
))
for
subdir
in
[
"HR"
,
"X2"
,
"X3"
,
"X4"
]:
for
subdir
in
[
"HR"
,
"X2"
]:
if
subdir
in
[
"HR"
]:
im_paths
=
glob
.
glob
(
os
.
path
.
join
(
dataset_dir
,
"DIV2K_{}_HR"
.
format
(
dataset_type
),
...
...
@@ -24,6 +24,6 @@ for subdir in ["HR", "X2", "X3", "X4"]:
grp
=
f
.
create_group
(
subdir
)
for
i
,
path
in
enumerate
(
im_paths
):
im
=
misc
.
imread
(
path
)
im
=
io
.
imread
(
path
)
print
(
path
)
grp
.
create_dataset
(
str
(
i
),
data
=
im
)
...
...
Please
register
or
login
to post a comment