首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >caffe+GAN︱PPGN生成模型5则官方案例(caffe版)

caffe+GAN︱PPGN生成模型5则官方案例(caffe版)

作者头像
悟乙己
发布2019-05-26 20:20:31
8150
发布2019-05-26 20:20:31
举报
文章被收录于专栏:素质云笔记素质云笔记

一、效果与架构

PPGN 整合了对抗训练、cnn特征匹配、降噪自编码、Langevin采样;在NIPS2016得到了Ian Goodfellow的介绍.

PPGN生成的图像同类差异化大,可根据指定生成不同类别的图像、多类化,生成的图像清楚分辨率高。

PPGN可使用imagenet1000类分类网络生成特定类别的图像。

效果:

这里写图片描述
这里写图片描述

架构图:

这里写图片描述
这里写图片描述

详细解读:zdx3578(微信公众号

二、案例

所需环境:caffe/python/GPU可以加速 确保你是在./caffe/python下运行settings.py Install ImageMagick command-line interface on your system.

1、案例一:1_class_conditional_sampling.sh

1_class_conditional_sampling.sh: Sampling conditioning on the class “junco” (output unit #13 of the CaffeNet DNNtrained on ImageNet dataset). This script produces a sampling chain for a single given class.

Running ./1_class_conditional_sampling.sh 13 produces this result:

这里写图片描述
这里写图片描述

2、2_class_conditional_sampling_many.sh

Running ./2_class_conditional_sampling_many.sh <epsilon1> with different epsilon1 (multiplier for the image prior component) produces a chain with different styles of samples:
这里写图片描述
这里写图片描述

3、3_hidden_conditional_sampling.sh

Instead of conditioning on a class, it is possible to condition on a hidden neuron i.e. performing Multifaceted Feature Visualization or synthesizing a set of inputs that highly activate a given neuron to understand what features it has learned to detect.

Running ./3_hidden_conditional_sampling.sh 196 produces a set of images for a conv5 neuron #196 previously identified as a "face detector" in DeepVis toolbox:
这里写图片描述
这里写图片描述

4、4_hidden_conditional_sampling_placesCNN.sh

One can repeat the example above but with an arbitrary neuron in a different condition network. Here, we visualize the conv5 neuron #182 in the AlexNet DNN trained on MIT Places205 dataset. This neuron has been previously identified as a “food detector” in Zhou et al [2].

Running ./4_hidden_conditional_sampling_placesCNN.sh 182 produces this result:
这里写图片描述
这里写图片描述

5、5_caption_conditional_sampling.sh

We can also replace the image classifier network in previous examples with a pre-trained image captioning network to form a text-to-image model without even re-training anything. The image captioning model in this example is the LRCN model in Donahue et al (2015) [1].

You would need to use the Caffe provided here and update the path to Caffe accordingly in settings.py The list of words supported are here

Running ./5_caption_conditional_sampling.sh a_church_steeple_that_has_a_clock_on_it produces this result:
这里写图片描述
这里写图片描述
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年01月11日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、效果与架构
  • 二、案例
    • 1、案例一:1_class_conditional_sampling.sh
      • 2、2_class_conditional_sampling_many.sh
        • 3、3_hidden_conditional_sampling.sh
          • 4、4_hidden_conditional_sampling_placesCNN.sh
            • 5、5_caption_conditional_sampling.sh
            领券
            问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档