|
1 |
| -<h1>Image Style Transfer using PyTorch</h1> |
2 |
| -<h2>About Project:</h2> |
3 |
| -<p> |
4 |
| - <img src='https://github.com/SurajChinna/Image-Style-Transfer-Pytorch/blob/master/assets/download.png' /> |
5 |
| - 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 <b>content image</b> and take another image from which the style is to be extracted usually called <b>style image</b>. This is the implementation of <a href='https://arxiv.org/pdf/1508.06576.pdf'>this</a> research paper. |
6 |
| -</p> |
| 1 | +# Image Style Transfer using PyTorch |
| 2 | +> Classifies whether an image is of a dog or cat based on the features |
7 | 3 |
|
8 |
| -<p> |
9 |
| - 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 <b>content</b> from later layers of CNN. For extracting the style of image, we take the correlations between different layers using <a href="https://en.wikipedia.org/wiki/Gramian_matrix">Gram Matrix</a> |
10 |
| -</p> |
| 4 | +## Table of contents |
| 5 | +* [About Project](#about-project) |
| 6 | +* [Languages or Frameworks Used](#languages-or-frameworks-used) |
| 7 | +* [Setup](#setup) |
11 | 8 |
|
12 |
| -<p> |
13 |
| - Initially, we take any random image as target(or taking the content image would be useful) and compute the <b>Content loss</b> and <b>Style loss</b> 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. |
14 |
| -</p> |
| 9 | +## About Project: |
15 | 10 |
|
16 |
| -<p> |
17 |
| - <b>Note:</b> 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 <b>style</b> and <b>content</b> 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. |
18 |
| -</p> |
| 11 | +  |
| 12 | + |
| 13 | + 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 <b>content image</b> and take another image from which the style is to be extracted usually called **style image**. This is the implementation of [this](https://arxiv.org/pdf/1508.06576.pdf) research paper. |
| 14 | + |
| 15 | + 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](https://en.wikipedia.org/wiki/Gramian_matrix) |
| 16 | + |
| 17 | + 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. |
| 18 | + |
| 19 | + **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. |
| 20 | + |
19 | 21 |
|
20 |
| -<h2>Languages or frameworks used</h2> |
21 |
| -<p> |
22 |
| -<ul> |
23 |
| - <li>Python: language</li> |
24 |
| - <li>NumPy: library for numerical calculations</li> |
25 |
| - <li>Matplotlib: library for data visualisation</li> |
26 |
| - <li>PIL: Python Image Library for opening and manage different image formats</li> |
27 |
| - <li>torch: a deep learning framework by Facebook AI Research Team</li> |
28 |
| - <li>torchvision: package consists of popular datasets, model architectures, and common image transformations for computer vision</li> |
29 |
| -</ul> |
30 |
| -</p> |
| 22 | + |
31 | 23 |
|
32 |
| -<h2>More Learning</h2> |
33 |
| -<p> |
34 |
| - <ul> |
35 |
| - <li>https://www.youtube.com/watch?v=R39tWYYKNcI&index=37&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF</li> |
36 |
| - <li>https://towardsdatascience.com/artistic-style-transfer-b7566a216431</li> |
37 |
| - </ul> |
38 |
| -</p> |
| 24 | +## Languages or Frameworks Used |
| 25 | + |
| 26 | + * Python: language |
| 27 | + * NumPy: library for numerical calculations |
| 28 | + * Matplotlib: library for data visualisation |
| 29 | + * Pytorch: a deep learning framework by Facebook AI Research Team for building neural networks |
| 30 | + * torchvision: package consists of popular datasets, model architectures, and common image transformations for computer vision |
| 31 | + |
| 32 | +## Setup |
| 33 | + |
| 34 | + To use this project, clone the repo |
| 35 | + |
| 36 | + ### Clone |
| 37 | + ``` |
| 38 | + git clone https://github.com/Surya-Prakash-Reddy/Image-Style-Transfer-Pytorch.git |
| 39 | + ``` |
| 40 | + |
| 41 | + 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. |
| 42 | + |
| 43 | +## More Learning |
| 44 | + |
| 45 | +* https://www.youtube.com/watch?v=R39tWYYKNcI&index=37&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF |
| 46 | +* https://towardsdatascience.com/artistic-style-transfer-b7566a216431 |
0 commit comments