An attempt to build an app for detecting and calculating handwritten math expressions. Unfortunately, I haven't been able to train a model with which I would be completely satisfied, but nonetheless it was a fun learning experience. Final implementation has trouble detecting '-', '(' and ')', but works quite well with expressions that do not use these symbols. Some cherry-picked examples are available in the examples folder :)
Two ways to run:
use command: python calculator.py
It accepts two arguments:
--visualize=True
opens the given image in a new window and draws the bounding boxes on it.
--img=path-to-input-image
to set input image. Default is examples/test.jpeg
Run python app.py
from the flask-app directory
Simple web-page for uploading pictures of math expressions which are then fed to the CNN model.
It runs on localhost:5000
Simple infix expression solver. Converts the given expression to postfix then evaluates it.
Loads the trained model stored in the 'bestmodel.h5' file, then uses it for predictions of given inputs.
Detects characters on the given image and returns their cropped bounding boxes.
Jupyter notebook describing the training process.