前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >论文实践学习 - Look into Person: Self-supervised Structure-sensitive Learning

论文实践学习 - Look into Person: Self-supervised Structure-sensitive Learning

作者头像
AIHGF
发布2019-02-18 10:30:54
8520
发布2019-02-18 10:30:54
举报
文章被收录于专栏:AIUAI

Look into Person: Self-supervised Structure-sensitive Learning

Code-Caffe

Paper

LIP Dataset - 百度云

LIP Dataset - Google Drive

attention+ssl.caffemodel - Google Drive

摘要——基于提供的训练模型进行测试, 模型是基于 Attention Model - Attention to Scale: Scale-aware Semantic Image Segmentation, 并提出 Self-supervised Structure-sensitive Loss 进行训练. 【论文阅读理解 - Look into Person: Self-supervised Structure-sensitive Learning】

方法框架:

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

网络结构:

主体网络采用的是 Deeplabv2- Attention,训练网络:

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

新增Caffe Layers:

部署网络:

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

简单测试示例 - demo.py

代码语言:javascript
复制
#!/usr/bin/env python
from PIL import Image
import numpy as np
import cv2
import matplotlib.pyplot as plt
import sys

caffe_root = './caffe_ssl/'
sys.path.insert(0, caffe_root + 'python')
import caffe

caffe.set_device(0)
caffe.set_mode_gpu()
# caffe.set_mode_cpu()

##
deploy  = 'model/deploy.prototxt'
weights = 'model/attention+ssl.caffemodel'
net = caffe.Net(deploy, weights, caffe.TEST)

mean = [104.008, 116.669, 122.675]

imgfile = './images/19.jpg'
# img = np.array(Image.open(imgfile), dtype=np.float32)
img = cv2.imread(imgfile, 1)
img = img.astype(np.float32)
img -= mean

img = cv2.resize(img, (513, 513), interpolation=cv2.INTER_LINEAR)

data = img.transpose((2, 0, 1))
net.blobs['data'].data[0, ...] = data

out = net.forward()
prediction = net.blobs['fc8_mask'].data[0, ...][0]
# output = net.blobs['fc8_interp'].data[0, ...]
# prediction = np.argmax(output.transpose([1, 2, 0]), axis=2)
plt.imshow(prediction)
plt.show()

print 'Done.'

Results

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017年10月17日,如有侵权请联系 cloudcommunity@tencent.com 删除

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

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

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

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Look into Person: Self-supervised Structure-sensitive Learning
    • 简单测试示例 - demo.py
      • Results
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档