Coder Social home page Coder Social logo

surya-prakash-reddy / image-style-transfer-pytorch Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 6.0 6.04 MB

Combine two images and produce new image with style of first image and content of second image

Jupyter Notebook 100.00%
image-style-transfer neural-style-transfer style-transfer pytorch pytorch-tutorial pytorch-implementation pytorch-cnn vgg vgg19

image-style-transfer-pytorch's Introduction

Image Style Transfer using PyTorch

Combine two images and produce new image with style of first image and content of second image

Table of contents

About Project:

Output of Model

The main goal of project is to combine two images and produce new image. The combination works in slightly different way i.e., we combine the style of one image with the content of other image. First we take the image from which we want to extract content usually called content image and take another image from which the style is to be extracted usually called style image. This is the implementation of this research paper.

Convolutional Neural Networks are a type of neural networks which are used widely in Image classification and recongnition. A CNN architecture called VGG19 has been used in this project. The starting layers in this architecture extract the basic features and shapes and later layers will extract more complex image patterns. So for the output image we will take the content from later layers of CNN. For extracting the style of image, we take the correlations between different layers using Gram Matrix

Initially, we take any random image as target(or taking the content image would be useful) and compute the Content loss and Style loss and decreasing these losses we would reach the perfect target image that has the style of one image and content of other image. For more learning checkout the links below.

Note: The notebook has been ran on Google Colab, If you are working on local machine some starting four cells can be ignored. To use this and produce new styled images, just change the links to the style and content variables, change the path in the last cell, and include the path where you want to save the styled image and run the entire notebook.

Languages or Frameworks Used

  • Python: language
  • NumPy: library for numerical calculations
  • Matplotlib: library for data visualisation
  • Pytorch: a deep learning framework by Facebook AI Research Team for building neural networks
  • torchvision: package consists of popular datasets, model architectures, and common image transformations for computer vision

Setup

To use this project, clone the repo

Clone

  git clone https://github.com/Surya-Prakash-Reddy/Image-Style-Transfer-Pytorch.git

After cloning, you can use the Style Transfer.ipynb notebook to learn or modify. If you want to use this and produce new styled images, just change the links to the style and content variables, change the path in the last cell, and include the path where you want to save the styled image and run the entire notebook.

More Learning

image-style-transfer-pytorch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.