math2latex is a tool that converts math images to LaTeX format. It provides a convenient way to convert handwritten or scanned math equations into LaTeX code, making it easier to incorporate them into documents or use them in mathematical typesetting.
To use math2latex, follow these steps:
-
Clone the repository:
git clone https://github.com/msdkhairi/math2latex.git
-
Navigate to the project directory:
cd math2latex
-
Install the required dependencies:
pip install -r requirements.txt
To prepare the data for conversion, run the following command in the root directory of the repository:
python math2latex/data/prepare_data.py --dataset-dir "dataset"
This will create a dataset folder with all the dataset files inside --dataset-dir directory.
The configuration for the training process can be found in the math2latex/config/config.py
file.
To train the model, run the following command in the root directory of the repository:
python math2latex/train.py
This will train the model using the dataset and save the trained model in each epoch in the runs
directory.
To test the model, run the following command in the root directory of the repository:
python math2latex/test.py
This will test the model using the test dataset and print the BLEU score, Edit Distance and Exact Match of the model.
To run the demo, run the following command in the root directory of the repository:
python demo.py
This command runs a demo of the tool, allowing you to see its functionality in action.
math2latex is licensed under the MIT License. See the LICENSE file for more details.