Giter VIP home page Giter VIP logo

tut-live-age-estimator's Introduction

TUT live age estimator

Python implementation of a live deep learning based age/gender/smile/celebrity twin recognizer.

Image

All components use convolutional networks:

  • Detection uses an SSD model trained on Tensorflow object detection API, but running on OpenCV.
  • Age, gender, and smile recognition use a multitask mobilenet trained and running on keras.
  • Celebrity twin uses a squeeze-excite seresnet18 to extract features, trained and running on keras.

The detailed functionality of the system (without multitask and celebrity similarity) is described in our paper:

Janne Tommola, Pedram Ghazi, Bishwo Adhikari, Heikki Huttunen, "Real Time System for Facial Analysis," Submitted to EUVIP2018.

If you use our work for research purposes, consider citing the above work.

Usage instructions:

Dependencies: OpenCV 4.0.1+, Tensorflow 1.8+, Keras 2.2.3+, and faiss.

  • Requires a webcam.
  • Tested on Ubuntu Linux 16.04, 18.04 and Windows 10 with and without a GPU.
  • Install OpenCV 4.0.1 or newer. Recommended to install with pip3 install opencv-python (includes GTK support, which is required). Freetype support for nicer fonts requires manual compilation of OpenCV.
  • Install Tensorflow (1.8 or newer). On a CPU, the MKL version seems to be radically faster than others (Anaconda install by smth like conda install tensorflow=1.10.0=mkl_py36hb361250_0. Seek for proper versions with conda search tensorflow.). On GPU, use pip3 install tensorflow-gpu.
  • Install Keras 2.2.3 (or newer). Earlier versions have a slightly different way of loading the models. For example: pip3 install keras.
  • Install dlib (version 19.4 or newer) with python 3 dependencies; e.g., pip3 install dlib.
  • Install faiss with Anaconda conda install faiss-cpu -c pytorch.
  • Run with python3 EstimateAge.py.

Required deep learning models and celebrity dataset. Extract directly to the main folder so that 2 new folders are created there.

Example video.

Contributors: Heikki Huttunen, Janne Tommola

tut-live-age-estimator's People

Contributors

jtomm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tut-live-age-estimator's Issues

Not run in python 3.6/3.7

2019-12-29 11:55:25.596039: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 9754 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:08:00.0, compute capability: 7.5)
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home/sentinela/VISAOCOMPUTACIONAL/Linuxfx-Age-Estimator/RecognitionThread.py", line 206, in run
ageout = self.ageNet.predict(np.expand_dims(agein, 0))[0]
File "/home/sentinela/.local/lib/python3.7/site-packages/keras/engine/training.py", line 1462, in predict
callbacks=callbacks)
File "/home/sentinela/.local/lib/python3.7/site-packages/keras/engine/training_arrays.py", line 324, in predict_loop
batch_outs = f(ins_batch)
File "/home/sentinela/.local/lib/python3.7/site-packages/tensorflow/python/keras/backend.py", line 3289, in call
self._make_callable(feed_arrays, feed_symbols, symbol_vals, session)
File "/home/sentinela/.local/lib/python3.7/site-packages/tensorflow/python/keras/backend.py", line 3222, in _make_callable
callable_fn = session._make_callable_from_options(callable_opts)
File "/home/sentinela/.local/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1489, in _make_callable_from_options
return BaseSession._Callable(self, callable_options)
File "/home/sentinela/.local/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1446, in init
session._session, options_ptr)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Tensor input_1:0, specified in either feed_devices or fetch_devices was not found in the Graph

Any IDEA?

configparser.ParsingError:

configparser.ParsingError: Source contains parsing errors: 'config.ini'

I am having this error while running code. It would be great if you will provide some input.

What does this code mean

i don't understand why below code is used

I expect two lines to be Convert range of x from 0 to 1,
but the subtraction codes below are totally incomprehensible.

i want to know why these code is used
thank you

@staticmethod
def preprocess_input(img):
	x = img - img.min()
	x = 255.0 * x / x.max()

	x[..., 0] -= 103.939
	x[..., 1] -= 116.779
	x[..., 2] -= 123.68
	return x

Save Resultant Video Option

Hi,
Thank you for awesome implementation. I was wondering how can we save the resultant video ? which files should i modify for this ?

add windows dependency please..

I only use Windows.
legacy project was successfully run with Windows.
but current updated project is doesn't work with Windows because "faiss" module is not support Windows.
can you modify this problem?
i really want Windows version.
thank you!

xrandr | grep "\*" | cut -d" " -f4 do not work on windows

Is this only supposed to work on linux because I think its a linux command...

xrandr | grep "*" | cut -d" " -f4

I get this error :

Using TensorFlow backend.
'xrandr' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
File "C:/Users/vaun_/PycharmProjects/TUT-live-age-estimator/EstimateAge.py", line 23, in
controllerThread = ControllerThread.ControllerThread(params)
File "C:\Users\vaun_\PycharmProjects\TUT-live-age-estimator\ControllerThread.py", line 45, in init
self.resolution = [int(s) for s in self.resolution]
File "C:\Users\vaun_\PycharmProjects\TUT-live-age-estimator\ControllerThread.py", line 45, in
self.resolution = [int(s) for s in self.resolution]
ValueError: invalid literal for int() with base 10: ''

Thanks

Camera Support

Are only USB cameras supported?

I have a network camera with RTSP enabled. Can this be a valid video source?

Thanks.

WIN10 Support

Faiss-cpu is not supported on WIN10
How can i use this on WIN10?

The deep learning model cannot be downloaded.

When I tried to download the model from Onedrive, some files were not downloaded. The limit of file downloads has been reached. The total number of file downloads cannot be greater than 200.

So could you please refresh the link?

Thanks a lot.

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.