Coder Social home page Coder Social logo

hadryan / sketch-to-art Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imfing/sketch-to-art

0.0 1.0 0.0 2.09 MB

๐Ÿ–ผ Create artwork from your casual sketch with GAN and style transfer

License: MIT License

JavaScript 14.45% HTML 0.27% Vue 20.73% Shell 1.04% Python 52.79% CSS 10.09% Dockerfile 0.63%

sketch-to-art's Introduction

Sketch to Art ๐ŸŽจ

You could be an artist with AI

[Live Demo] Note: Only frontend is available now

Or you can Run with Docker in minutes

Introduction

This project can transform your casual sketch to beautiful painting/artwork using modern AI technology.

Screenshots

Run with Docker

With Docker, you can quickly build and run the entire application in minutes ๐Ÿณ

# 1. First, clone the repo
git clone https://github.com/mtobeiyf/sketch-to-art.git
cd sketch-to-art

# 2. Build Docker image
docker build -t sketch-to-art:dev .

# 3. Run!
docker run -it --rm -p 8080:8080 -p 5001:5001 -p 5002:5002 sketch-to-art:dev

Then, go to localhost:8080 and play with the demo! ๐ŸŽ‰

Theories

To achieve the goal, there are mainly two steps in the pipeline:

  • Reconstruct and generate real image from the sketch
  • Arbitary style transfer to beautify the result with given result

Sketch Reconstruction

The principle behind this is called Conditional Adversarial Networks, known as pix2pix, which is able to generate image based on the given image.

Style Transfer

It became known to us with the appearance of Prisma app. Typically, we generate an individual model for each pre-defined style. Here, we want to go further by using any new picture as the style. So, we adopted the method, Universal Style Transfer via Feature Transforms proposed in NIPS2017, which enables us to perform arbitary style transfer.

Manual Installation

Backend

The server side is powered by Python and Flask. You can see this simpler example. Navigate to the server directory and all the files concerning the service and neural networks are there. The two main files:

  • app_pix.py for pix2pix translation
  • app_stylize.py for arbitrary style transfer

Prerequisites

Make sure you have Python installed, and some packages are needed: tensorflow, keras, pillow, flask, gevent. You can use pip to install them:

pip install -r server/requirements.txt

Run

# Simply run with python
python app_xxx.py

And you could see the output indicating the port it's listening (5001 and 5002). Go to http://localhost:5001 and you should see the returned information.

Frontend

You should installed:

# Clone the repo
git clone [email protected]:mtobeiyf/sketch-to-art.git
cd sketch-to-art

# Install dependencies
yarn  # or npm install

# Run
yarn dev  # or npm run dev

Open your favorite browser at http://localhost:8080, the site is there.

Acknowledgments

This is the final project of Digital Image Processing instructed by Prof. Jia Yan.

Authors

Xin Fu, Shuaibin Zhang, Tangbo Liu, Haoran Su

License

Copyright ยฉ 2018, Fing

Released under the MIT License.

sketch-to-art's People

Contributors

dependabot[bot] avatar imfing avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.