Giter Site home page Giter Site logo

bemoregt / cascade-classifier-trainer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joyeecheung/cascade-classifier-trainer

0.0 2.0 0.0 112 KB

Scripts to train the OpenCV cascade classifer with Haar features for AdaBoost.

Python 65.29% Shell 34.71%

cascade-classifier-trainer's Introduction

Training OpenCV cascade classifier

Directory structure

.
├─ pos (positive samples database containing .jpg images)
│   └── ...
├─ positive (selected positive samples)
│   └── ...
├─ random (random images to generate negative samples with)
│   └── ...
├─ negative (generated negative samples)
│   └── ...
├─ classifier (directory to hold trained classifiers)
│   └── ...
├─ list_pos.py (script to generate data for vec files )
├─ get_negative.py (script to generate negative samples)
└─ lish.sh (script to drive the whole process)

How to use it

  1. Create the directory structure above
  2. Put your positive samples(should be images with a fixed size) in pos
  3. Put some images that doesn't contain your detection target under random (the size doesn't matter, but they shouldn't be too big, otherwise you will get a bunch of monotone images, which are pretty useless as negative samples)
  4. Configure variables in list.sh
  5. Run bash list.sh

A word about the size of the vec file

From Traincascade Error: Bad argument, the size of the vec file should be N >= numPos + numPos * (1 - minHitRate) * (numStages - 1) + S, where S is a count of all the skipped samples from vec-file (for all stages). Here we do a simpler formula, the number of positive samples supplied for opencv_traincascade is POS=N-S, and N(the size of the vec file) is just the number of all positive samples you have.

cascade-classifier-trainer's People

Contributors

joyeecheung avatar

Watchers

Gromit Park 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.