Giter Club home page Giter Club logo

object_detector's Introduction

object_detector

Object Detector using HOG as descriptor and Linear SVM as classifier

Prerequisites

Install OpenCV 3 with Python 3 bindings

Dependencies

You can install all dependencies by running

pip install -r requirements.txt

Run the code

To test the code, run the lines below in your terminal

git clone https://github.com/vladkha/object_detector.git
cd object_detector/bin
python test_object_detector.py

The test_object_detector.py will download the CelebA and WIDER FACE datasets and train a classifier to detect faces in an image. The SVM model files will be stored in data/models, so that they can be reused later on in test_classifier.py

Configuration File

All the configurations are in the data/config/config.cfg configuration files. You can change it as per your need. Here is what the default configuration file looks like

[hog]
window_size: [178, 218]
window_step_size: 20
orientations: 9
pixels_per_cell: [8, 8]
cells_per_block: [3, 3]
visualise: False
normalise: None

[nms]
threshold: 0.4

[paths]
model_path: ../data/models/model_name.model

[general]
pyramid_downscale = 1.5
pos_samples = 1000
neg_samples = 1000

About modules

  • config.py -- imports the configuration variables from config.cfg
  • create_neg_samples_WIDER.py -- module to create negative samples (images of non-faces from WIDER dataset)
  • extract_features.py -- module used to extract HOG features of the training images
  • train_classifier.py -- module used to train the classifier
  • test_classifier.py -- module used to test the classifier using a test image
  • utils.py -- module containing helper functions

Some results

Detections before NMS Detections after NMS

Built With

TODO

Possible ways to improve the project:

  • Make the sliding window computation run in parallel - can dramatically speedup the code
  • Split processing of the image pyramid in test_classifier.py to different cores of the processor, that way each core can process a separate layer of the pyramid independently
  • Add bootstrapping (Hard Negative Mining)

Acknowledgments

License

This project is licensed under the MIT License - see the LICENSE file for details

object_detector's People

Contributors

vladkha avatar imgbotapp avatar

Watchers

James Cloos 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.