Git Product home page Git Product logo

nerual_style_change's Introduction

使用VGG19迁移学习实现图像风格迁移

这是一个使用预训练的VGG19网络完成图片风格迁移的项目,使用的语言为python,框架为tensorflow。

给定一张风格图片A和内容图片B,能够生成具备A图片风格和B图片内容的图片C。

下面给出两个示例,风格图片都使用梵高的星夜:

风格图片

示例1:

网络上找到的一张风景图片。

内容图片:

内容图片1

生成图片:

生成图片1

示例2:

嗷嗷嗷,狼人嚎叫~

内容图片:

内容图片2

生成图片:

生成图片2

更多详情请移步博客https://blog.csdn.net/aaronjny/article/details/79681080


快速开始

1.下载预训练的vgg网络,并放入到项目的根目录中

模型有500M+,故没有放到GitHub上,有需要请自行下载。

下载地址:http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat

2.选定风格图片和内容图片,放入项目根目录下的images文件夹中

在项目根目录下的images文件夹中,有两张图片,分别为content.jpgstyle.jpg,即内容图片和风格图片。

如果只是使用默认图片测试模型,这里可以不做任何操作。

如果要测试自定义的图片,请使用自定义的内容图片和/或风格图片替换该目录下的内容图片和/或风格图片,请保持命名与默认一致,或者在settings.py中修改路径及名称。

3.开始生成图片

运行项目中的train.py文件,进行训练。在训练过程中,程序会定期提示进度,并保存过程图片。

当训练结束后,保存最终生成图片。

所有生成的图片均保存在项目根目录下output文件夹中。

4.更多设置

settings.py文件中存在多种配置项,可根据需求进行配置。

nerual_style_change's People

Contributors

aaronjny avatar

Watchers

James Cloos 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.