Neural network turns screenshots into code, insists it’s just a toy
To demonstrate that deep learning can generate platform-specific UI code from a single screenshot, while warning that it is strictly a research toy.

What it does pix2code takes a screenshot of a graphical user interface and generates code for iOS, Android, or web front ends. It does this by first predicting a custom domain-specific language from the image, then compiling that intermediate representation into Android XML, iOS Storyboard, or HTML/CSS with Bootstrap. The authors report over 77% token-level accuracy on their test sets, measured by comparing generated DSL tokens against expected ones.
The interesting bit The project is admirably honest about its own limitations: the README repeatedly calls itself a “toy example” and states it is “not, in any way, intended, nor able to generate code in a real-world context.” That level of self-awareness is rare, and the included FAQ directly addresses whether front-end developers will lose their jobs to this system. (Spoiler: the authors say no.)
Key highlights
- Generates an intermediate
.guiDSL before compiling to target platform code - Trains on roughly 109 million parameters; about five hours per dataset on a Tesla K80
- Supports three output targets: Android XML, iOS Storyboard, and HTML/CSS
- Accuracy is measured at the token level against the ground-truth DSL sequence
- Explicitly provided for educational and research purposes only; no end-user support
Caveats
- The authors emphasize this is experimental research, not a production tool, and will not work for your specific use cases
- No further platforms or languages will be added; the project is frozen to maintain consistency with the published paper
- The 77% accuracy figure applies to the intermediate DSL tokens, not necessarily to the final compiled output or real-world layout fidelity
Verdict Worth a look if you are studying neural code generation or the history of design-to-code research; front-end developers looking for a production assistant should look elsewhere, as the authors themselves suggest.
Frequently asked
- What is tonybeltramelli/pix2code?
- To demonstrate that deep learning can generate platform-specific UI code from a single screenshot, while warning that it is strictly a research toy.
- Is pix2code open source?
- Yes — tonybeltramelli/pix2code is open source, released under the Apache-2.0 license.
- What language is pix2code written in?
- tonybeltramelli/pix2code is primarily written in Python.
- How popular is pix2code?
- tonybeltramelli/pix2code has 12k stars on GitHub.
- Where can I find pix2code?
- tonybeltramelli/pix2code is on GitHub at https://github.com/tonybeltramelli/pix2code.