← Open Source
ashnkumar

sketch-code

Keras model to generate HTML code from hand-drawn website mockups. Implements an image captioning architecture to drawn source images.

TutorialsML/AI fundamentalsPython
Open on GitHub
Momentum
+1stars in 24 hours+0.0%
5.14k
Stars
675
Forks
+1
This week
2
Contributors
Created 2018-01-19 · Updated 2026-10-16 · #4620 today
Top developers
ashnkumarAn-hyeonyoung

ashnkumar/sketch-code is ranked 4,620 with 5,142 stars.

Same-category comparison

ashnkumar/sketch-code is ranked 4,620 among these 8 peers; udacity/deep-reinforcement-learning is ranked 4,613.

Same-category comparison
NameRankMetrics
phodal/understand-prompt4,582
Language:
Jupyter Notebook
Stars:
5,620
Forks:
440
karpathy/neuraltalk4,594
Language:
Python
Stars:
5,508
Forks:
1,330
Description:
NeuralTalk is a Python+numpy project for learning Multimodal Recurrent Neural Networks that describe images with sentences.
jaungiers/LSTM-Neural-Network-for-Time-Series-Prediction4,606
Language:
Python
Stars:
5,233
Forks:
1,959
Description:
LSTM built using Keras Python package to predict time series steps and sequences. Includes sin wave and stock market data.
udacity/deep-reinforcement-learning4,613
Language:
Jupyter Notebook
Stars:
5,181
Forks:
2,368
Description:
Repo for the Deep Reinforcement Learning Nanodegree program.
paullarionov/claude-certified-architect4,627
Language:
HTML
Stars:
5,040
Forks:
1,206
jcjohnson/pytorch-examples4,640
Language:
Python
Stars:
4,918
Forks:
918
Description:
Simple examples to introduce PyTorch.
jonkrohn/ML-foundations4,644
Language:
Jupyter Notebook
Stars:
4,900
Forks:
2,320
Description:
Machine Learning Foundations: Linear Algebra, Calculus, Statistics & Computer Science.
EnzeD/vibe-coding4,654
Stars:
4,790
Forks:
417
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryTutorials
SubcategoryML/AI fundamentals
Stars5,142
Forks675
Contributors2
Created date2018-01-19
Updated date2026-10-16
Stars in 1 day1
Stars in 7 days1
Rank4,620
Previous rank4,792
Rank change172
7-day stars rank9,057
Previous 7-day stars rank11,786
7-day stars rank change2,729
Total stars rank2,740
Previous total stars rank2,739
Total stars rank change-1
CountryUSA
README summary

SketchCode *Generating HTML Code from a hand-drawn wireframe* **Built in 2018, preserved as-is. ** SketchCode came out of the Insight AI Fellowship, back when solving this meant training a model specifically for it. It did, on wireframes close to the 1,700-image synthetic dataset it was trained on. x and Keras of that era and is no longer maintained; it stands as a record of what this problem took before general-purpose vision-language models started doing it

zero-shot. SketchCode is a deep learning model that takes hand-drawn web mockups and converts them into working HTML code. It uses an image captioning architecture to generate its HTML markup from hand-drawn website wireframes. For more information, check out this post: Automating front-end development with deep learning This project builds on the synthetically generated dataset and model architecture from pix2code by Tony Beltramelli and the Design Mockups project from Emil Wallner. Note: This project is meant

as a proof-of-concept; the model isn't (yet) built to generalize to the variability of sketches seen in actual wireframes, and thus its performance relies on wireframes resembling the core dataset. Portions of this project derive from pix2code, which is licensed under the Apache License, Version 2. See NOTICE for the required attributions and the terms that apply to those portions.

Frequently asked questions

How many stars and forks are recorded?

ashnkumar/sketch-code has 5,142 stars and 675 forks.

What is the repository rank?

ashnkumar/sketch-code is ranked 4,620.

What language and category are recorded?

ashnkumar/sketch-code has 5,142 stars, uses Python and belongs to Tutorials.

Which repository is closest in rank?

ashnkumar/sketch-code is compared with udacity/deep-reinforcement-learning, ranked 4,613 with 5,181 stars.

README

SketchCode

Generating HTML Code from a hand-drawn wireframe

Built in 2018, preserved as-is. SketchCode came out of the Insight AI Fellowship, back when solving this meant training a model specifically for it. The technique of the moment was image captioning — a CNN encoder feeding an LSTM decoder — and the bet was that the same architecture would work if you treated HTML as the caption. It did, on wireframes close to the 1,700-image synthetic dataset it was trained on. The code targets TensorFlow 1.x and Keras of that era and is no longer maintained; it stands as a record of what this problem took before general-purpose vision-language models started doing it zero-shot.

SketchCode is a deep learning model that takes hand-drawn web mockups and converts them into working HTML code. It uses an image captioning architecture to generate its HTML markup from hand-drawn website wireframes.

For more information, check out this post: Automating front-end development with deep learning

This project builds on the synthetically generated dataset and model architecture from pix2code by Tony Beltramelli and the Design Mockups project from Emil Wallner.

Note: This project is meant as a proof-of-concept; the model isn't (yet) built to generalize to the variability of sketches seen in actual wireframes, and thus its performance relies on wireframes resembling the core dataset.

Setup

Prerequisites

  • Python 3 (not compatible with python 2)
  • pip

Install dependencies

pip install -r requirements.txt

Example Usage

Download the data and pretrained weights:

# Getting the data, 1,700 images, 342mb
git clone https://github.com/ashnkumar/sketch-code.git
cd sketch-code
cd scripts

# Get the data and pretrained weights
sh get_data.sh
sh get_pretrained_model.sh

Converting an example drawn image into HTML code, using pretrained weights:

cd src

python convert_single_image.py --png_path ../examples/drawn_example1.png \
      --output_folder ./generated_html \
      --model_json_file ../bin/model_json.json \
      --model_weights_file ../bin/weights.h5

General Usage

Converting a single image into HTML code, using weights:

cd src

python convert_single_image.py --png_path {path/to/img.png} \
      --output_folder {folder/to/output/html} \
      --model_json_file {path/to/model/json_file.json} \
      --model_weights_file {path/to/model/weights.h5}

Converting a batch of images in a folder to HTML:

cd src

python convert_batch_of_images.py --pngs_path {path/to/folder/with/pngs} \
      --output_folder {folder/to/output/html} \
      --model_json_file {path/to/model/json_file.json} \
      --model_weights_file {path/to/model/weights.h5}

Train the model:

cd src

# training from scratch
#  adds Keras ImageDataGenerator augmentation for training images
python train.py --data_input_path {path/to/folder/with/pngs/guis} \
      --validation_split 0.2 \
      --epochs 10 \
      --model_output_path {path/to/output/model}
      --augment_training_data 1

# training starting with pretrained model
python train.py --data_input_path {path/to/folder/with/pngs/guis} \
      --validation_split 0.2 \
      --epochs 10 \
      --model_output_path {path/to/output/model} \
      --model_json_file ../bin/model_json.json \
      --model_weights_file ../bin/pretrained_weights.h5 \
      --augment_training_data 1

Evalute the generated prediction using the BLEU score

cd src

# evaluate single GUI prediction
python evaluate_single_gui.py --original_gui_filepath  {path/to/original/gui/file} \
      --predicted_gui_filepath {path/to/predicted/gui/file}

# training starting with pretrained model
python evaluate_batch_guis.py --original_guis_filepath  {path/to/folder/with/original/guis} \
      --predicted_guis_filepath {path/to/folder/with/predicted/guis}

License

MIT — see LICENSE.

Portions of this project derive from pix2code, which is licensed under the Apache License, Version 2.0. See NOTICE for the required attributions and the terms that apply to those portions.

Nearby in the ranking
Similar items