Git Product home page Git Product logo

cv-module-face-trainer's Introduction

CV module: Face Trainer

Trains a given OpenCV recognition object by preparing the given training set and call the train function of the recognizer.

The training set directories have to have the format LABEL.IGNORED_INFORMATION where the label has to be before the dot . in the directory name.

A suitable folder structure might be the following:

.
.
├── training_set
|   ├── label.1
|   |   ├── image.1.jpg
|   |   ├── . . .
|   |   └── image.n.jpg
|   ├── label.2
|   ├──  . . .
|   └── label.n
.
.

Installation and usage

  1. Open a terminal window, navigate to your project and add this python as submodule as following:
git submodule add https://github.com/n1g1r1/cv-module-face-trainer modules/face_trainer
  1. Import it as python module:
from modules.face_trainer import trainer
  1. Call the train function:
train(recognizer, training_set_path)

Parameters

  • recognizer: The given OpenCV recognizer.
  • training_set_path: The path to the training set.

Capture functon

Or if you have to capture some webcam images first:

capture(detector, label, classifier = "lbp", resize = False, resize_factor = 0.5, make_training_set = True, training_set_size = 20, make_validation_set = False, validation_set_size = 20, training_set_path = 'data/training', validation_set_path = 'data/validation')

Parameters

  • detector: The detector module to use it for the face detection.
  • label: The label that has to be used to make the set directory and save the images with the correct naming.
  • classifier: The face classifier method that will be used for the face detection. Default: lbp.
  • resize: Should the image get resized? Default: False.
  • resize_factor: Resize factor, if resized. Default: 0.5.
  • make_training_set: Should the algorithm make the training set? Default: True.
  • training_set_size: How many images will be shot and saved. Default: 20.
  • make_validation_set: Should the algorithm make the validation set? Default: False.
  • validation_set_size: How many images will be shot and saved. Default: 20
  • training_set_path: Where the training set gets stored. Default: data/training.
  • validation_set_path: Where the validation set gets stored. Default: data/validation.

cv-module-face-trainer's People

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.