Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Detection
elasticsearch/sentiment-dashboard
images
train_models
README.md
client.py
conv_blocks.py
elasticsearch.yml
finetune-emotion.ipynb
kibana.yml
live-es.py
live.py
mobilenet.py
mobilenet_v2.py
save-face.py
server-es.py
standard_fields.py
triplet-loss-2d.ipynb
triplet-loss.ipynb
visualization_utils.py

README.md

Face-Analysis-Elastic

Face analysis with deep learning models and elastic search

alt text

How-to-Install

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-6.x.list
apt-get update && apt-get install elasticsearch
apt-get update && apt-get install kibana
pip3 install scipy tweepy elasticsearch numpy sklearn scikit-learn Flask gunicorn eventlet unidecode flask_cors
cp elasticsearch.yml /etc/elasticsearch/
cp kibana.yml /etc/kibana/
service elasticsearch start
service kibana start

Steps

You can download my pretrained models from here

1. Download emotion dataset from here, unzip in the same directory.

2. Download pretrained models from here, unzip in the same directory.

3. Finetune Mobilenet V2 for our new emotion dataset, finetune-emotion.ipynb.

Accuracy graph from Tensorboard alt text

Cross-entropy graph from Tensorboard alt text

4. Capture face to train our face detection.

python3 save-face.py husein

5. Train Mobilenet V2 for face detection using triplet loss, triplet-loss.ipynb.

2D embedded from triplet-loss-2d.ipynb

alt text

6. Testing with live.py.

alt text

7. I found it headless server cannot detect webcam, so I created streaming application using Flask socketio from my camera slave to my server.

edit server-es.py,

socketio.run(app, host = '0.0.0.0', port = 6020,debug=True)

edit client.py,

# make sure same port and ip with server-es.py
socketIO = SocketIO('http://192.168.0.1', 6020)

Visit-the-index

You can check the dashboard from http://huseinhouse.com/elasticsearch/sentiment-dashboard/