Giter Club home page Giter Club logo

bistek-face's Introduction

🅱️isualization Tool in Keras for Facial Expression Recognition

The present repo contains a Python tool-script to run a neural network visualize a facial expression recognizer in realtime.

The repo includes a pre-trained model for facial expression recognition.

Setup

The packages needed are the following:

The easiest way to install them is by using the conda env included in this repo. To do so, just be sure to have Anaconda installed and run the following:

git clone https://github.com/RodolfoFerro/bistek-face.git
cd bistek-face
conda env create -f environment.yml

After this you can activate the environment by running:

source activate bistek

To deactivate the environment:

source deactivate

Usage

You can specify the labels for each class in the classes.txt, the classes will be indexed in the same order as in this file.

The main script contains a parser in which any extra required can be specified:

(bistek) python main.py -h

This outputs the following:

Using TensorFlow backend.
usage: main.py [-h] [-c CLASSES] [-hc HAAR] [-hcp HAARPATH] [-rs RESIZING]
               [-fs RESIZING] [-m MODEL] [-w WEIGHTS]

optional arguments:
  -h, --help            show this help message and exit
  -c CLASSES, --classes CLASSES
                        Path to custom txt file containing classes.
  -hc HAAR, --haar HAAR
                        Haar cascade to be used for face detection.
  -hcp HAARPATH, --haarpath HAARPATH
                        Path to Haar cascades for face detection.
  -rs RESIZING, --resizing RESIZING
                        Image width for resizing.
  -fs FRAMESIZE, --framesize FRAMESIZE
                        Set frame size:
                         (1) 640x360
                         (2) 320x180
  -m MODEL, --model MODEL
                        Path to custom model in Keras' json format.
  -w WEIGHTS, --weights WEIGHTS
                        Path to custom weights in Keras' h5 format.

With this, you can specify any path to any of the files to be used, or specify the resizing of the images to be processed by the neural net.

An example (using some flags) to run the pre-trained network included in this repo would be the following:

(bistek) python main.py -c "classes.txt" -rs 48 -fs 2 -m "./models/base_model.json" -w "./models/base_model.h5"

License

MIT License

Copyright (c) 2018 Rodolfo Ferro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bistek-face's People

Contributors

rodolfoferro avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

hugomitre yisampi

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.