This repository provides code to generate images of ambiguous handwritten mathematical expressions. It includes scripts for model training and inference.
Set up the Python environment and install all required dependencies:
uv sync --all-packages --lockedPlease download the preprocessed data from Hugging Face. After downloading the dataset, extract it with the following command:
tar --zstd -xvf mathwriting_with_graph.tar.zst -C ~To train on the MathWriting dataset, run:
python scripts/train.pyPlace the pretrained model gryphgen_graph_sd_mathwriting_epoch_50.pth in the AmbHMEG directory.
python scripts/generate.pypython scripts/generate_gh.py --edit layout
python scripts/generate_gh.py --edit symbolThis project is licensed under the MIT License. See LICENSE for more details.
This project makes use of the MathWriting dataset developed by Google Research. We acknowledge and thank the original authors for providing this valuable resource. The dataset is licensed under CC BY-NC-SA 4.0. Users are responsible for complying with the terms of this license when using the dataset or any derived outputs.