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-16 10:23:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ced2d3421400d68341138e4f605cee67b64e0e3e
ced2d342
1 parent
ea107c1b
fixed video test code
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
code/tfrecord_writer.py
code/yolov3/convert_weights.py
code/yolov3/video_test.py
code/yolov3/yolov3.ipynb
code/tfrecord_writer.py
View file @
ced2d34
...
...
@@ -16,7 +16,7 @@ def readImage(path):
def
main
():
ANNOTATION_PATH
=
'../data/train.txt'
#annotation set (train/val/test) text file
IMAGE_DIRECTORY
=
'image_data
/
'
#image directory
IMAGE_DIRECTORY
=
'image_data'
#image directory
SAVE_PATH
=
'train.tfrecord'
#save path for tfrecord
print
(
'Tensorflow version:'
,
tf
.
__version__
)
#tensorflow version should be 1.x
...
...
code/yolov3/convert_weights.py
View file @
ced2d34
...
...
@@ -12,8 +12,9 @@ img_size = 416
weight_path
=
'../../data/darknet_weights/yolov3.weights'
save_path
=
'../../data/darknet_weights/yolov3.ckpt'
anchors
=
parse_anchors
(
'../../data/yolo_anchors.txt'
)
class_num
=
1
model
=
yolov3
(
80
,
anchors
)
model
=
yolov3
(
class_num
,
anchors
)
with
tf
.
Session
()
as
sess
:
inputs
=
tf
.
placeholder
(
tf
.
float32
,
[
1
,
img_size
,
img_size
,
3
])
...
...
code/yolov3/video_test.py
View file @
ced2d34
...
...
@@ -14,19 +14,19 @@ from data_utils import letterbox_resize
from
model
import
yolov3
parser
=
argparse
.
ArgumentParser
(
description
=
"YOLO-V3 video test procedure."
)
parser
.
add_argument
(
"
input_video"
,
type
=
str
,
parser
.
add_argument
(
"
--input_video"
,
type
=
str
,
default
=
"../../data/video.mp4"
,
help
=
"The path of the input video."
)
parser
.
add_argument
(
"--anchor_path"
,
type
=
str
,
default
=
"./data/yolo_anchors.txt"
,
parser
.
add_argument
(
"--anchor_path"
,
type
=
str
,
default
=
".
./..
/data/yolo_anchors.txt"
,
help
=
"The path of the anchor txt file."
)
parser
.
add_argument
(
"--new_size"
,
nargs
=
'*'
,
type
=
int
,
default
=
[
416
,
416
],
help
=
"Resize the input image with `new_size`, size format: [width, height]"
)
parser
.
add_argument
(
"--letterbox_resize"
,
type
=
lambda
x
:
(
str
(
x
)
.
lower
()
==
'true'
),
default
=
True
,
help
=
"Whether to use the letterbox resize."
)
parser
.
add_argument
(
"--class_name_path"
,
type
=
str
,
default
=
"./data/classes.txt"
,
parser
.
add_argument
(
"--class_name_path"
,
type
=
str
,
default
=
".
./..
/data/classes.txt"
,
help
=
"The path of the class names."
)
parser
.
add_argument
(
"--restore_path"
,
type
=
str
,
default
=
".
/data/darknet_weights/yolov3
.ckpt"
,
parser
.
add_argument
(
"--restore_path"
,
type
=
str
,
default
=
".
./data/trained/model
.ckpt"
,
help
=
"The path of the weights to restore."
)
parser
.
add_argument
(
"--save_video"
,
type
=
lambda
x
:
(
str
(
x
)
.
lower
()
==
'true'
),
default
=
Fals
e
,
parser
.
add_argument
(
"--save_video"
,
type
=
lambda
x
:
(
str
(
x
)
.
lower
()
==
'true'
),
default
=
Tru
e
,
help
=
"Whether to save the video detection results."
)
args
=
parser
.
parse_args
()
...
...
code/yolov3/yolov3.ipynb
View file @
ced2d34
...
...
@@ -1672,7 +1672,8 @@
" save_path = '/content/gdrive/My Drive/yolo/weights/yolov3.ckpt'
\n
"
,
" anchors = parse_anchors('/content/gdrive/My Drive/yolo/data/yolo_anchors.txt')
\n
"
,
"
\n
"
,
" model = yolov3(80, anchors)
\n
"
,
" class_num = 1
\n
"
" model = yolov3(class_num, anchors)
\n
"
,
" with tf.Session() as sess:
\n
"
,
" inputs = tf.placeholder(tf.float32, [1, img_size, img_size, 3])
\n
"
,
"
\n
"
,
...
...
Please
register
or
login
to post a comment