ACL 2025: Synthetic data generation pipelines for text-rich images.
170
stars
10
commits
Python
primary language
Mar 1, 2025
updated
This is the repository for the generation system of the PixMo-Docs, CoSyn-400K, and CoSyn-point datasets. PixMo-Docs was used to train the Molmo model, and the CoSyn datasets are an expanded version that use an improved pipeline and more types of documents. More details can be found in our paper.
After cloning the repo, you can install the required dependencies using the following commands:
conda create --name pixmo-doc python=3.10
conda activate pixmo-doc
pip install -r requirements.txt
Then export your API key as an environment variable:
export OPENAI_API_KEY=your-api-key
export ANTHROPIC_API_KEY=your-api-key
export HF_TOKEN=your-api-key # only if you want to upload the dataset to the Hugging Face Hub
You need to install the following packages to use some of the pipelines:
LaTeX: the installation depends on your operating system, you can refer to the official LaTeX website for more details.
Mermaid: you can refer to here to install the Mermaid CLI using npm:
npm install -g @mermaid-js/mermaid-cli
HTML: install playwright with:
pip install playwright
playwright install
mplfinance:
pip install mpl_finance<=0.10.1 mplfinance<=0.12.10b0
cairosvg:
pip install cairosvg<=2.7.1
The main.py script is the entry point for the generation of the dataset. You can use the following main arguments to control the generation process:
python main.py -p {PIPELINE} \
-t {TYPE_OF_DATA_YOU_WANT_TO_GENERATE} \
-n {NUMBER_OF_SAMPLES} \
-m {NAME_OF_DATASET} \
For example, python main.py -p "MatplotlibChartPipeline" -n 5 -m "matplotlib_test" -t "bar chart", will generate 5 bar charts using the MatplotlibChartPipeline and save them with the name "matplotlib_test".
You can use comma separated values for the -p and -t arguments to generate multiple types of data using different pipelines at the same time.
Please refer to the main.py script for more details on the available arguments and their usage.
We released 25 pipelines to generate eight main categories of text-rich images: charts, tables, documents, diagrams, circuits, specialized graphics, and pointing. Each pipeline uses one renderer/programming language to generate the images.
Chart:
Table:
Document:
.docx documents.Diagram:
Circuit:
Specialized Graphics:
Web Screens:
Pointing:
Please cite the following papers if you use this codebase or our datasets in your work.
@article{yang2025scaling,
title={Scaling Text-Rich Image Understanding via Code-Guided Synthetic Multimodal Data Generation},
author={Yang, Yue and Patel, Ajay and Deitke, Matt and Gupta, Tanmay and Weihs, Luca and Head, Andrew and Yatskar, Mark and Callison-Burch, Chris and Krishna, Ranjay and Kembhavi, Aniruddha and others},
journal={arXiv preprint arXiv:2502.14846},
year={2025}
}
@article{deitke2024molmo,
title={Molmo and pixmo: Open weights and open data for state-of-the-art multimodal models},
author={Deitke, Matt and Clark, Christopher and Lee, Sangho and Tripathi, Rohun and Yang, Yue and Park, Jae Sung and Salehi, Mohammadreza and Muennighoff, Niklas and Lo, Kyle and Soldaini, Luca and others},
journal={arXiv preprint arXiv:2409.17146},
year={2024}
}
Python
100.0%
ACL 2025: Synthetic data generation pipelines for text-rich images.
170
stars
10
commits
Python
primary language
Mar 1, 2025
updated
This is the repository for the generation system of the PixMo-Docs, CoSyn-400K, and CoSyn-point datasets. PixMo-Docs was used to train the Molmo model, and the CoSyn datasets are an expanded version that use an improved pipeline and more types of documents. More details can be found in our paper.
After cloning the repo, you can install the required dependencies using the following commands:
conda create --name pixmo-doc python=3.10
conda activate pixmo-doc
pip install -r requirements.txt
Then export your API key as an environment variable:
export OPENAI_API_KEY=your-api-key
export ANTHROPIC_API_KEY=your-api-key
export HF_TOKEN=your-api-key # only if you want to upload the dataset to the Hugging Face Hub
You need to install the following packages to use some of the pipelines:
LaTeX: the installation depends on your operating system, you can refer to the official LaTeX website for more details.
Mermaid: you can refer to here to install the Mermaid CLI using npm:
npm install -g @mermaid-js/mermaid-cli
HTML: install playwright with:
pip install playwright
playwright install
mplfinance:
pip install mpl_finance<=0.10.1 mplfinance<=0.12.10b0
cairosvg:
pip install cairosvg<=2.7.1
The main.py script is the entry point for the generation of the dataset. You can use the following main arguments to control the generation process:
python main.py -p {PIPELINE} \
-t {TYPE_OF_DATA_YOU_WANT_TO_GENERATE} \
-n {NUMBER_OF_SAMPLES} \
-m {NAME_OF_DATASET} \
For example, python main.py -p "MatplotlibChartPipeline" -n 5 -m "matplotlib_test" -t "bar chart", will generate 5 bar charts using the MatplotlibChartPipeline and save them with the name "matplotlib_test".
You can use comma separated values for the -p and -t arguments to generate multiple types of data using different pipelines at the same time.
Please refer to the main.py script for more details on the available arguments and their usage.
We released 25 pipelines to generate eight main categories of text-rich images: charts, tables, documents, diagrams, circuits, specialized graphics, and pointing. Each pipeline uses one renderer/programming language to generate the images.
Chart:
Table:
Document:
.docx documents.Diagram:
Circuit:
Specialized Graphics:
Web Screens:
Pointing:
Please cite the following papers if you use this codebase or our datasets in your work.
@article{yang2025scaling,
title={Scaling Text-Rich Image Understanding via Code-Guided Synthetic Multimodal Data Generation},
author={Yang, Yue and Patel, Ajay and Deitke, Matt and Gupta, Tanmay and Weihs, Luca and Head, Andrew and Yatskar, Mark and Callison-Burch, Chris and Krishna, Ranjay and Kembhavi, Aniruddha and others},
journal={arXiv preprint arXiv:2502.14846},
year={2025}
}
@article{deitke2024molmo,
title={Molmo and pixmo: Open weights and open data for state-of-the-art multimodal models},
author={Deitke, Matt and Clark, Christopher and Lee, Sangho and Tripathi, Rohun and Yang, Yue and Park, Jae Sung and Salehi, Mohammadreza and Muennighoff, Niklas and Lo, Kyle and Soldaini, Luca and others},
journal={arXiv preprint arXiv:2409.17146},
year={2024}
}
Python
100.0%