Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
PET_Project1
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-07 05:00:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eb0f63a8e23423ce88e0c57666dce280333b1d9a
eb0f63a8
1 parent
f7a5b7fd
updated data util module
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
code/yolov3/data_utils.py
code/yolov3/data_utils.py
View file @
eb0f63a
...
...
@@ -43,10 +43,10 @@ def parse_tfrecord(data):
def
parse_record
(
features
):
# tfrecord parser for TFRecordIterator (primitive data)
index
=
int
(
features
[
'index'
])
encoded_image
=
np
.
frombuffer
(
features
[
'image'
],
dtype
=
np
.
uint8
)
width
=
int
(
features
[
'width'
])
height
=
int
(
features
[
'height'
])
index
=
int
(
features
[
'index'
]
[
0
]
)
encoded_image
=
np
.
frombuffer
(
features
[
'image'
]
[
0
]
,
dtype
=
np
.
uint8
)
width
=
int
(
features
[
'width'
]
[
0
]
)
height
=
int
(
features
[
'height'
]
[
0
]
)
boxes
=
features
[
'boxes'
]
assert
len
(
boxes
)
%
5
==
0
,
'Annotation error occured in box array.'
...
...
@@ -56,7 +56,7 @@ def parse_record(features):
labels
=
[]
for
i
in
range
(
box_cnt
):
label
,
x_min
,
y_min
,
x_max
,
y_max
=
int
(
boxes
[
i
*
5
]),
float
(
boxes
[
i
*
5
+
1
]),
float
(
boxes
[
i
*
5
+
2
]),
float
(
boxes
[
i
*
5
+
3
])
label
,
x_min
,
y_min
,
x_max
,
y_max
=
int
(
boxes
[
i
*
5
]),
float
(
boxes
[
i
*
5
+
1
]),
float
(
boxes
[
i
*
5
+
2
]),
float
(
boxes
[
i
*
5
+
3
])
,
float
(
boxes
[
i
*
5
+
4
])
aligned_boxes
.
append
([
x_min
,
y_min
,
x_max
,
y_max
])
labels
.
append
(
label
)
...
...
Please
register
or
login
to post a comment