Skip to content

A web application project that utilizes a custom CNN PyTorch model to digitalize (aka translate) pictures of algebraic expressions into LaTeX and functional Python code.

License

Notifications You must be signed in to change notification settings

Ramstric/cnn-math-expressions-api

Repository files navigation

CNN-powered Math Expression Translator

This web application (Project for Sistemas Inteligentes at UPM) uses a Convolutional Neural Network (CNN) to translate handwritten math equations into LaTeX and Python function code.

Demo

You can try out the demo here.

Table of Contents

API Endpoints

Upload File

  • URL: /upload
  • Method: POST
  • Description: Upload a file to the server.
  • Request:
    • file: The file to upload.
  • Response:
    {
        "message": "File uploaded successfully!"
    }

Process Image

  • URL: /process
  • Method: GET
  • Description: Process the uploaded image.
  • Response:
    {
        "message": "Image processed successfully!",
        "num_segments": "<number_of_segments>"
    }

Download Image

  • URL: /download
  • Method: GET
  • Description: Download processed images.
  • Parameters:
    • image: The type of image to download (processed, contours, segmented).
    • n: The segment number (for segmented images).
  • Response: The requested image file.

Predict

  • URL: /predict
  • Method: GET
  • Description: Get the LaTeX and Python function code for the predicted equation.
  • Response:
    {
        "latex": "<latex_code>",
        "python": "<python_function_code>"
    }

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A web application project that utilizes a custom CNN PyTorch model to digitalize (aka translate) pictures of algebraic expressions into LaTeX and functional Python code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published