김성주

fixed video test code

......@@ -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
......
......@@ -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])
......
......@@ -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=False,
parser.add_argument("--save_video", type=lambda x: (str(x).lower() == 'true'), default=True,
help="Whether to save the video detection results.")
args = parser.parse_args()
......
......@@ -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",
......