Git Product home page Git Product logo

facerec's Introduction

facerec

Python based framework for OpenCV's Fisher faces

Example

  • Train the recognizer, predict few results and save data
from facerec import FaceRecognizer, ImageSet, LabelSet, concatenate

recognizer = FaceRecognizer()
img1 = ImageSet("Female_faces")
label1 = LabelSet("Female", img1)
img2 = ImageSet("Male_faces")
label2 = LabelSet("Male", img2)

imgs = concatenate(img1, img2)
labels = concatenate(label1, label2)
recognizer.train(imgs, labels)

img = ImageSet("Test_images")
print recognizer.predict(img)
recognizer.save("gender.xml")
  • Load data and predict.
recognizer = FaceRecognizer()
recognizer.load("gender.xml")
img = ImageSet("Test_images")
print recognizer.predict(img)
  • Crop faces from the image (multiple faces in one image support added)
imgs = ImageSet("images with faces")
faces = imgs.cropFaces("cascadefile.xml")
# or
# faces = imgs.cropFaces() # to use the default cascade file included
# faces is ImageSet object
faces.show()
  • Show Images
img = ImageSet("image_folder/")
img.show(delay=500) # This uses default opencv display.
# delay is in milliseconds

facerec's People

Contributors

jayrambhia avatar

Watchers

James Cloos avatar Jay Shaik 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.