Inspiration
We often had to draw graphs for Algorithms and Graph Theory classes, but converting them to TikZ to include in our LaTeX documents was always tedious. GraphTeX is the solution!
What it does
Takes an image of a hand-drawn graph and converts it to TikZ code, which can be included in a LaTeX document. It uses the DETR and LETR object/line detection models to process the images, then converts the output into TikZ code.
How we built it
We used React for frontend and Flask for backend.
We first procedurally generated the training data (which consists of images of graphs and bounding boxes of nodes and edges in the graph) for the DETR model. We used networkx to generate images of graphs and obtain coordinates of the nodes in the graph. Using these coordinates, we calculated bounding boxes on both the edges and nodes.
We trained the DETR on the generated training data.
Then we built a script that converts the output of the DETR model to Latex code.
Challenges we ran into
We ran out of time integrating the vision models we trained into the backend. The time crunch was definitely difficult, as the model did not work as expected initially. Also, generating thousands of graphs and creating the input data was very time consuming. Issues with Google Drive prevented us from being able to finish, because it was slow to keep uploading our training data to drive for use in Google Colab, where the models had to be trained.
Accomplishments that we're proud of
The training data was time consuming to create, but we were proud of the result. Also, we were happy with how our app looks.
What we learned
Generating your own training data is difficult! We also learned about how to use object detection models.
What's next for GraphTeX
We will try to finish incorporating the models into the backend and deploy the app!
Log in or sign up for Devpost to join the conversation.