Object Detection annotation Convert to Yolo Darknet Format: Click here
Class file:
Copy the 'kitti_classes.txt' in the folder of `\model_data` folder
Modify train.py
Open 'train.py' file in VS Code\
Go to LIne 16 : def main():. Change the ''annotation' and 'classes-path' to your setting.
Go to LIne 32: Change the name of the pre-trained weight file.
We will use COCO trained weight file as we used above(yolo.h5). Create a copy and name it asyolo_weights.h5
Run Train
Start training by running the following in the terminal
Evaluate
Use your trained weights or checkpoint weights with command line option --model model_file when using yolo_video.py Remember to modify the class path or anchor path.
usage: yolo_video.py [-h] [--model MODEL] [--anchors ANCHORS]
[--classes CLASSES] [--gpu_num GPU_NUM] [--image]
[--input] [--output]
positional arguments:
--input Video input path
--output Video output path
optional arguments:
-h, --help show this help message and exit
--model MODEL path to model weight file, default model_data/yolo.h5
--anchors ANCHORS path to anchor definitions, default
model_data/yolo_anchors.txt
--classes CLASSES path to class definitions, default
model_data/coco_classes.txt
--gpu_num GPU_NUM Number of GPU to use, default 1
--image Image detection mode, will ignore all positional arguments
if is_tiny_version:
model = create_tiny_model(input_shape, anchors, num_classes,
freeze_body=2, weights_path='model_data/yolo_tiny_weights.h5')
else:
model = create_model(input_shape, anchors, num_classes,
freeze_body=2, weights_path='model_data/yolo_weights.h5') # make sure you know what you freeze