Skip to content

line of sight detector using deep learning technology

Notifications You must be signed in to change notification settings

raynux/boardeye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BoardEye

Line of sight detector using deep learning technology

Motivation

Just wanted to use Keras and Vision API :)

What does it do?

  • Capture your face by a webcam (tested only on Mac), and classify it by Google Vision API
  • Train a neural network based on results from Vision API
  • Predict input from a webcam

At the end, your neural network should be able to classify whether you are looking at the display or now.

Setup

Assuming that you already have NodeJS and Keras working.

npm install
export GOOGLE_API_KEY=XXXXXX

If you would like to try prediction now, download a trained model and place them under data. Then go Prediction section below.

Generating Training Data

You need two kinds of pictures - looking at your display or not.

So, to collect looking(=1) data, run

node capture.js -d data/1

To collect not looking(=0) data, also run

node capture.js -d data/0

Repeat above as many times as you can. More data, always better. So, I've done like

for i in {1..10}; do
  echo progress $i
  say "$i"
  ./capture.js -d data/1
done

Then let's convert them to CSV files

node csvgen.js -d data/1 > data/csv/1.csv
node csvgen.js -d data/0 > data/csv/0.csv

Training

After generating a bunch of data, it's time to train a brain

python train.py

It defaults to 5000 epoch. Generated model and weights are automatically saved. If you would like to train more, just run it again.

Prediction

All set. Let's test it out!

node capture.js

Then copy the output, then

python predict.py COPIED_TEXT

Now you should see 0 or 1. Did it work? :)

About

line of sight detector using deep learning technology

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published