mzbac / sketch2code

a simple model that implemented sketch to code
116 stars 40 forks source link
deep-learning html machine-learning

Sketch2code

Preview

Generating HTML Code from a hand-drawn wireframe

a simple 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.

Heavily inspired by Ashwin Kumar's blog post, For more information, check out his post: Automating front-end development with deep learning

Model architecture

model

Download the data

bash get_data.sh

Docker demo settings

docker pull mzbac/sketch2code
docker run -p 5000:5000 mzbac/sketch2code

browser to localhost:5000

Load pre-trained weights

encoder = torch.load('model_weights/encoder_resnet34_0.061650436371564865.pt')
decoder = torch.load('model_weights/decoder_resnet34_0.061650436371564865.pt')

Pre-trained weight preview:

loss_0.061

Pre-trained model's BLEU score