# texture_generation_master
**Repository Path**: liufenglin/texture_generation_master
## Basic Information
- **Project Name**: texture_generation_master
- **Description**: A tensorflow Implementation of paper: Incorporating long-range consistency in CNN-based texture generation
- **Primary Language**: Python
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-03-03
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# texture_generation_master
Implementation of paper: Incorporating long-range consistency in CNN-based texture generation (https://arxiv.org/pdf/1606.01286.pdf) by Tensorflow.
## Requirements
- [Tensorflow]
- [Pillow]
- [scipy]
- [VGG 19 model](https://drive.google.com/file/d/0B8QJdgMvQDrVU2cyZjFKU1RrLUU/view?usp=sharing)
## Generating
Need to download the vgg19 model and put it with main.py
```
python main.py
```
This command will generate the texture with only the style loss, without the long-range loss in the paper.
This code will generate the texture with a noisy image.
```
python main.py --cc_loss
```
This command will generate the texture with the style loss and the long-range loss in the paper.
```
python main.py --content --content_path ./images/content.jpg --style_path ./images/brick2.jpg --iteration 3000 --cc_loss
```
This command will use the content imageA and style imageB, which means generate images with the content in imageA and style in imageB.
This command will not use the long-range loss in the paper.
```
python main.py --content --content_path ./images/content.jpg --style_path ./images/brick2.jpg --iteration 3000
```
This command has same function about the last command, but it will use the long-range loss.
## Examples

**The left is style image,the right is content Input.**

**The left is Output without cc_loss, the right is the Output with cc_loss.**
**Without the cc_loss, the generated texture is mixed and disorderly.**
**With the help of the long-range loss, the rendering of regular textures is better**.

**The left is style image,the right is content Input.**

**The left is Output without cc_loss, the right is the Output with cc_loss.**
**The regular texture is also generated better when combining the content image and style image.**
**You could change the hyperparameters to get better peformance.**