Giter Site home page Giter Site logo

omarshawky15 / arabicmathsolver-server Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 110.7 MB

Arabic math solver (server) is a flask web server that recognizes an image of a mathematical expression in Arabic notation and applies an operation on it like integration, differentiation, etc.

License: GNU General Public License v3.0

Procfile 0.05% Python 98.94% HTML 1.02%
arabic-nlp equation-solver mathematics mathmatical python server-side arabic arabic-numbers ocr opencv

arabicmathsolver-server's Introduction

Arabic Math Solver - Server Side

OpenCV Flask TensorFlow

is a flask web app which recognizes sent image of an Arabic mathematical expression through characters' segmentation, characters recognition, and parsing them into a mathematical expression then apply an operation on it e.g (solving the roots of polynomial, integration, etc).

Table of Contents

Examples

Expression Image HTML Recognition Output
س ٢+٣*س+٢
(لـو٢(٨)+ظا(٤٥))\(س ٢+√(س+٦))

Getting Started

Prerequisites

  • python >= 3.8.12

Installation (For windows)

  1. Clone the repo

git clone [email protected]:omarshawky15/ArabicMathSolver-Server.git

  1. Create a virtual environment

python -m venv venv

  1. Activate the virtual environment

source venv/Scripts/activate

  1. Install the required packages

pip install -r requirements.txt

Usage

  • To start the local server, run

python app.py

then upload the image to the server and see the html output. (Default operation: solving the roots of polynomial)

  • To use without running the server, uncomment the runLocal() function in app.py, insert the image path, and comment app.run().

Main Components

Segmentation

The image is partitioned into multiple cropped characters by analyzing their contours using OpenCV.

Recognition

Each character is recognized using our trained tensorflow model which consists of the following layers.

Layer (type) Output Shape Param #
(BatchNormalization) (None, 32, 32, 1) 4
(Conv2D) (None, 32, 32, 64) 1664
(Conv2D) (None, 32, 32, 64) 102464
(MaxPooling2D) (None, 16, 16, 64) 0
(Dropout) (None, 16, 16, 64) 0
(Conv2D) (None, 16, 16, 128) 73856
(Conv2D) (None, 16, 16, 128) 147584
(MaxPooling2D) (None, 8, 8, 128) 0
(Dropout) (None, 8, 8, 128) 0
(Flatten) (None, 8192) 0
(Dropout) (None, 8192) 0
(Dense) (None, 256) 2097408
(Dense) (None, 43) 11051

Parsing

Symbols are parsed together to form a mathematical expression where different combinations are handled like fraction, power, square root, ..etc

Output

The chosen operation (integration, differentiation, etc.) is applied on the mathematical expression using SymPy which is a library for symbolic mathematics. Then both the expression and the operation output are translated back to Arabic mathematical notation.

Related Projects

Arabic Math Solver - Android App

License

This application is released under GNU GPLv3 (see LICENSE).

For more details, see the graduation project book.

arabicmathsolver-server's People

Contributors

abbdelrhman avatar abobakr9 avatar elsayed5454 avatar omarshawky15 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.