All Projects → ashnkumar → Sketch Code

ashnkumar / Sketch Code

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

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Sketch Code

Pytorch Toolbelt
PyTorch extensions for fast R&D prototyping and Kaggle farming
Stars: ✭ 942 (-79.27%)
Mutual labels:  augmentation, image-processing
Segmentation
Catalyst.Segmentation
Stars: ✭ 27 (-99.41%)
Mutual labels:  augmentation, image-processing
Caer
High-performance Vision library in Python. Scale your research, not boilerplate.
Stars: ✭ 452 (-90.05%)
Mutual labels:  augmentation, image-processing
Albumentations
Fast image augmentation library and an easy-to-use wrapper around other libraries. Documentation: https://albumentations.ai/docs/ Paper about the library: https://www.mdpi.com/2078-2489/11/2/125
Stars: ✭ 9,353 (+105.83%)
Mutual labels:  augmentation, image-processing
Pesdk Android Demo
A fully customizable photo editor for your app.
Stars: ✭ 464 (-89.79%)
Mutual labels:  image-processing
Cvlib
A simple, high level, easy to use, open source Computer Vision library for Python.
Stars: ✭ 443 (-90.25%)
Mutual labels:  image-processing
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (-90.27%)
Mutual labels:  image-processing
Teaching
Teaching Materials for Dr. Waleed A. Yousef
Stars: ✭ 435 (-90.43%)
Mutual labels:  image-processing
Qgis Earthengine Examples
A collection of 300+ Python examples for using Google Earth Engine in QGIS
Stars: ✭ 482 (-89.39%)
Mutual labels:  image-processing
Augmentor
Image augmentation library in Python for machine learning.
Stars: ✭ 4,594 (+1.1%)
Mutual labels:  augmentation
Pba
Efficient Learning of Augmentation Policy Schedules
Stars: ✭ 461 (-89.85%)
Mutual labels:  augmentation
Simpleitk
SimpleITK: a layer built on top of the Insight Toolkit (ITK), intended to simplify and facilitate ITK's use in rapid prototyping, education and interpreted languages.
Stars: ✭ 458 (-89.92%)
Mutual labels:  image-processing
Imgproxy
Fast and secure standalone server for resizing and converting remote images
Stars: ✭ 5,688 (+25.18%)
Mutual labels:  image-processing
Wasm Imagemagick
Webassembly compilation of https://github.com/ImageMagick/ImageMagick & samples
Stars: ✭ 442 (-90.27%)
Mutual labels:  image-processing
Compressor
An easy to use and well designed image compress library for Android, based on Android native image library. Put forward a framework for quick switch from different compress algorithm.
Stars: ✭ 476 (-89.52%)
Mutual labels:  image-processing
Cvpr2021 Papers With Code
CVPR 2021 论文和开源项目合集
Stars: ✭ 7,138 (+57.09%)
Mutual labels:  image-processing
Gaussianblur
An easy and fast library to apply gaussian blur filter on any images. 🎩
Stars: ✭ 473 (-89.59%)
Mutual labels:  image-processing
Halide
a language for fast, portable data-parallel computation
Stars: ✭ 4,722 (+3.92%)
Mutual labels:  image-processing
Scikit Image
Image processing in Python
Stars: ✭ 4,688 (+3.17%)
Mutual labels:  image-processing
Photo Editor Android
Photo Editor SDK contains a lot of features like edit, scale, rotate and draw on images like Instagram stories.
Stars: ✭ 463 (-89.81%)
Mutual labels:  image-processing

SketchCode

Generating HTML Code from a hand-drawn wireframe

Preview

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
# <augment_training_data> 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

The MIT License (MIT)

Copyright (c) 2018 Ashwin Kumar<ash.nkumar@[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].