# Neural Style Transfer
[Neural style transfer](https://arxiv.org/abs/1508.06576) is an algorithm that combines the content of one image with the style of another image using CNN. Given a content image and a style image, the goal is to generate a target image that minimizes the content difference with the content image and the style difference with the style image.
<p align="center"><img width="100%" src="png/neural_style2.png" /></p>
#### Content loss
To minimize the content difference, we forward propagate the content image and the target image to pretrained [VGGNet](https://arxiv.org/abs/1409.1556) respectively, and extract feature maps from multiple convolutional layers. Then, the target image is updated to minimize the [mean-squared error](https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/neural_style_transfer/main.py#L81-L82) between the feature maps of the content image and its feature maps.
#### Style loss
As in computing the content loss, we forward propagate the style image and the target image to the VGGNet and extract convolutional feature maps. To generate a texture that matches the style of the style image, we update the target image by minimizing the mean-squared error between the Gram matrix of the style image and the Gram matrix of the target image (feature correlation minimization). See [here](https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/neural_style_transfer/main.py#L84-L94) for how to compute the style loss.
<br>
## Usage
```bash
$ pip install -r requirements.txt
$ python main.py --content='png/content.png' --style='png/style.png'
```
<br>
## Results
The following is the result of applying variaous styles of artwork to Anne Hathaway's photograph.
![alt text](png/neural_style.png)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Pytorch_pytorch深度学习教程之神经风格迁移.zip (10个子文件)
Pytorch_pytorch深度学习教程之神经风格迁移
neural_style_transfer
main.py 4KB
png
neural_style.png 1.3MB
content.png 599KB
style4.png 1.86MB
style2.png 947KB
style.png 681KB
style3.png 1.21MB
neural_style2.png 493KB
requirements.txt 34B
README.md 2KB
共 10 条
- 1
资源评论
Mopes__
- 粉丝: 1410
- 资源: 407
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python爬虫代码详解
- 力道图数据,是一篇论文里的
- 无损压缩音频格式ERAC
- google-chrome-stable_current_x86_64 (1)(1).rpm
- Java源代码案例 - 使用正则表达式解析sql语法树.zip
- Dijkstra算法和Floyd算法 C++源代码案例.zip
- visualstudio安装教程
- 基于Selenium的Java爬虫实战(内含谷歌浏览器Chrom和Chromedriver版本123.0.6272.2)
- 小熊派BearPi-Pico H2821 SLE通信OLED显示.zip
- Anaconda3-2023.09-0-Linux-aarch64.sh
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功