Git Product home page Git Product logo

yolo-object-detection's Introduction

YOLO Algorithm for Object Detection

Issues Forks Stars Ajay Dabas

In this project, I used YOLO algorithm trained on COCO dataset for object detection task. I used pretrained Yolov2 model which can downloaded from the official YOLO website.

Examples

Photo by Steffen Muldbjerg on Unsplash Photo by Alexander McFeron on Unsplash

Requirements

Recommended System Requirements to run model.

  • A good CPU and a GPU with atleast 4GB memory
  • Atleast 8GB of RAM
  • Active internet connection to download YOLOv2 weights and cfg file.

Required Libraries for Python along with their version numbers used while making & testing of this project

  • Python - 3.6.7
  • Numpy - 1.16.4
  • Tensorflow - 1.13.1
  • Keras - 2.2.4
  • PIL - 4.3.0

Some YOLOv2 Model information

  1. Total params: 50,983,561
  2. Trainable params: 50,962,889
  3. Non-trainable params: 20,672

How to Use

Just follow 6 simple steps :

  1. Clone repository to preserve directory structure
    git clone https://github.com/dabasajay/YOLO-Object-Detection.git
  2. Download Darknet model cfg and weights from the official YOLO website and put them in model_data/ folder.
    Direct terminal commands
    wget https://pjreddie.com/media/files/yolov2.weights
    mv yolov2.weights "model_data/yolov2.weights"
    wget https://github.com/pjreddie/darknet/raw/master/cfg/yolov2.cfg
    mv yolov2.cfg "model_data/yolov2.cfg"
  3. Review config.py for paths and other configurations (explained below)
  4. Run yad2k.py to convert YOLOv2 model from darknet to keras model which will be saved in model_data/ folder.
  5. Put all your images you want to test in images/ directory.
    Note: All images are resized to 608x608 to feed into YOLOv2 model
  6. Run YOLO.py and MAGIC! Output images will be saved in output/ directory

If you face any problem converting keras model or anything: email me at [email protected]

Acknowledgement: Script yad2k.py for conversion of darknet to keras model is taken from Allan Zelener - YAD2K: Yet Another Darknet 2 Keras github repo and modified a little bit.

Configurations (config.py)

  1. keras_model_path :- File path of keras converted yolov2 model in .hdf5 format
  2. model_weights :- File path of yolov2 weights file from darknet (Downloaded file)
  3. model_cfg :- File path of yolov2 configuration file from darknet (Downloaded file)
  4. anchors_path :- File path of yolo_anchors.txt
  5. classes_path :- File path of coco_classes.txt
  6. test_path :- Folder path containing images for testing model
  7. output_path :- Folder path containing output of images from test_path
  8. score_threshold :- Score(Confidence of predicted class) threshold. Lower value leads to more class predictions but less confident about predictions, higher leads to less class predictions but more confident about predictions.
  9. iou_threshold :- Intersection over union threshold.
  10. random_seed :- Random seed for reproducibility of results
  11. font_path :- File path of font to write on bounding boxes in image

References

The ideas presented in this repo came primarily from the two YOLO papers. The implementation here also took significant inspiration and used many components from Allan Zelener's github repository. The pretrained weights used in this project came from the official YOLO website.

yolo-object-detection's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.