Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
BSH_Project2
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
이혜리
2020-06-04 00:25:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2b67deadc15fed345c6ea175e8bc5a454e64ce2d
2b67dead
1 parent
e301219c
testset 파일 만들기
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
make_testset.py
make_testset.py
0 → 100644
View file @
2b67dea
import
os
import
numpy
as
np
from
imageio
import
imread
from
skimage.transform
import
resize
import
hickle
as
hkl
from
setting
import
*
desired_im_sz
=
(
128
,
160
)
#높이,너비
base_dir
=
os
.
path
.
join
(
DATA_DIR
,
'testset/'
)
im_list
=
[]
source_list
=
[]
# corresponds to recording that image came from
X_t
=
[]
for
top
,
dir
,
f
in
os
.
walk
(
base_dir
):
if
(
len
(
f
)
>
0
):
f
.
sort
()
im_list
+=
[
top
+
'/'
+
f
[
idx
]
for
idx
in
range
(
len
(
f
))]
start
=
top
.
rfind
(
'/'
)
source_list
+=
[
top
[
start
+
1
:]]
*
11
print
(
len
(
im_list
))
# X_t = np.zeros((len(im_list),) + desired_im_sz + (3,))
for
i
,
im_file
in
enumerate
(
im_list
):
im
=
imread
(
im_file
)
im
=
resize
(
im
,
(
desired_im_sz
[
0
],
desired_im_sz
[
1
]))
X_t
.
append
(
im
)
X_t
=
np
.
array
(
X_t
)
hkl
.
dump
(
X_t
,
os
.
path
.
join
(
DATA_DIR
,
'X_test.hkl'
))
hkl
.
dump
(
source_list
,
os
.
path
.
join
(
DATA_DIR
,
'sources_test.hkl'
))
# np.save(DATA_DIR + 'X_test', X_t)
# np.save(DATA_DIR + 'sources_test', source_list)
\ No newline at end of file
Please
register
or
login
to post a comment