n3rdd / Object-Detection-YOLOv2

Object detection project using YOLOv2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object Detection with YOLOv2

Final project by Group 2 (Localization) in HDU CS Innovation & Practice Course (2018 Spring).

Inspiration

This repo is based on Car-detection-PA, containing a tutorial for YOLOv2, which is a programming assignment in Convolutional Neural Networks by Andrew Ng.

Requirements

Installation

Use pip to install the required packages in your command line. Visit the official sites above for more details.

pip install numpy h5py
pip install tensorflow # CPU-only
pip install keras
pip install opencv-python

Get Started

  • Download (Password: 8kim) an existing pretrained Keras YOLO model stored in yolo.h5. (These weights come from the official YOLO website, and were converted using a function written in YAD2K) and put it into model_data/ folder.
  • Put your test image/video in images/ or videos/.
  • Set your image/video file and shape in yolo_v2.py.
if __name__ == '__main__':
    '''
    code
    '''
    # Set the original image/video shape
    image_shape = (960., 544.) # (height, width)
    
    # Detect a video
    video_file = "traffic.mp4"
    predict_video(sess, video_file) # output in out/

    # Uncomment the code below to detect an image
    # out_scores, out_boxes, out_classes = predict_image(sess, "person.jpg")
  • Run the model in your command line.
python yolo_v2.py
  • The prediction info will be printed into output.txt.
  • The notebook version will be uploaded very soon.

More Details

# todo

TODOs

  • Unify the interface in the video detection part.
  • Train the model.
  • Try YOLOv3.
  • ...

Reference

About

Object detection project using YOLOv2.


Languages

Language:Python 100.0%