Coder Social home page Coder Social logo

suman9868 / pedestrian_detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinay0410/pedestrian_detection

0.0 0.0 0.0 2.67 MB

Detects Pedestrians in images using HOG as a feature extractor and SVM for classification

License: GNU General Public License v3.0

Python 97.92% Shell 2.08%

pedestrian_detection's Introduction

Pedestrian Detection

Dependencies

  • OpenCV
  • scikit-image pip install scikit-image==0.14.1
  • scikkit-learn pip install scikit-learn==0.20.2

Running Detection

To test on images, simply run, python detectmulti.py -i <path to image>

For example, python detectmulti.py -i sample_images/pedestrian.jpg

For more options run, python detectmulti.py -h

Following are some examples,

Pedestrian Pedestrian

Pedestrian Pedestrian

Training

This code is meant for Training a Pedestrian Detector using INRIA Person Dataset.

Download, Uncompress and place it in the root of this repository.

Then just run:

sudo sh fixpng.sh # To fix the broken png files in this dataset.

Note: The above step is necessary to fix the broken pngs in the dataset, without running this the classifer won't be correctly trained.

To train just run:

python train.py --pos <path to positive images> --neg <path to negative images>

For INRIA dataset, this would be probably,

python train.py --pos INRIAPerson/train_64x128_H96/pos --neg INRIAPerson/train_64x128_H96/neg

After training, two new files would be created, namely, person.pkl and person_final.pkl. The former is the pre eliminary detector and the latter is the improved (hard negatively mined) detector.

Note on Training:

Training can use high amounts of memory, so be sure to have a swap space in case of RAM overflows. Also, memory consumption can be reduced by decreasing the maximum number of hard negative windows to be mined. This is defined by the MAX_HARD_NEGATIVES global variable in train.py.

Testing

After successful training just run:

python test.py --pos <path to positive images> --neg <path to negative images>

For INRIA dataset, this would be probably,

python test.py --pos INRIAPerson/test_64x128_H96/pos --neg INRIAPerson/test_64x128_H96/neg

This would print True Positives, True Negatives, False Positives, False Negatives, Precision, Recall and F1 Score.

pedestrian_detection's People

Contributors

vinay0410 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.