digitclassifier
is a JdeRobot component which captures live video and classifies the digits found in every frame with a convolutional neural network. Implementations in both Keras and Tensorflow are available.
In order to test it with Python 2.7 you must install:
- JdeRobot (installation guide)
- OpenCV 3 (it will be automatically installed with JdeRobot)
Aditionally, you will need a few Python packages, generally installable via python-pip
. We have prepared a requirements.txt
file, which will automatically install all these dependencies by running:
pip2 installl -r requirements.txt
If you want to launch digitclassifier
, open a terminal and run:
cameraserver cameraserver.cfg
This command will start cameraserver
driver, which will serve
video from the webcam. In another terminal run:
python digitclassifier.py digitclassifier.yml
That command should launch the component and you should see something like this:
digitclassifier.yml
file contains fields to choose which framework
to use during live digit classification (Framework
), as well
as the path to the corresponding model (Model
). For example, if
you want to test Keras model, your config. file should look something like
this:
... Framework: "Keras" # Currently supported: "Keras" or "Tensorflow" Model: "Estimator/Keras/Model/net.h5" # path to model ...
And if you want to test TensorFlow model:
... Framework: "TensorFlow" # Currently supported: "Keras" or "Tensorflow" Model: "Estimator/TensorFlow/mnist-model/" # path to model ...
If you want to train a new model with the augmented MNIST datasets we used for training, here they are:
About Keras implementation: [http://jderobot.org/Dpascual-tfg]
About TensorFlow implementation: [http://jderobot.org/Naxvm-tfg]