The Math Problem Solver is a web-based application that allows users to capture mathematical problems using a camera and instantly get solutions, including step-by-step explanations. The app uses the Google Generative AI API to process images of math problems and generate accurate solutions.
Visit Us : https://hosting.pythonanywhere.com/
- Real-time Camera Capture: Users can point their camera at a math problem and capture it.
- AI-Powered Problem Solving: The app processes the captured image and generates a solution using advanced AI models.
- User-Friendly Interface: A clean and interactive UI with floating shapes and intuitive buttons.
- Install Python 3.7+.
- Install Flask.
- Obtain an API key from Google Generative AI.
-
Clone the repository from GitHub:
git clone https://github.com/yourusername/math-ocr-solver cd math-ocr-solver -
Install required Python packages:
pip install flask google-generativeai
-
Add your Google Generative AI API key:
- Replace the placeholder in
Main.py:genai.configure(api_key="YOUR_API_KEY")
- read GET_GOOGLE_API.md for more info
- Replace the placeholder in
-
Run the Flask app:
python Main.py
-
Open the application in your browser at http://127.0.0.1:5000.
- Access the web app.
- Use your device's camera to point at a math problem.
- Click the Capture Image button.
- Wait for the solution to appear below the camera feed.
The backend is powered by a Flask server. Upon capturing an image, the file is sent to the /process-image endpoint. The endpoint:
- Saves the uploaded image.
- Sends it to the Google Generative AI model for processing.
- Returns the solution as a JSON response.
The frontend is designed with HTML, CSS, and JavaScript:
- HTML structure (
index.html) provides the layout. - CSS (
static/style.css) styles the page, adding floating shapes and clean typography. - JavaScript handles camera operations and image capture.
- Add support for advanced math problems like calculus and differential equations.
- Enhance OCR capabilities for handwritten equations.
- Include voice recognition for spoken math problems.
This project is licensed under the MIT License. See LICENSE for more details.