Simon Shi的小站

人工智能,机器学习, 强化学习,大模型,自动驾驶

0%

CV PoseEstimation Method

[TOC]

Human Pose Estimation

论文/原理 S-单人
D-多人
DensePose 实时人体姿态估计
单人姿态估计
DeepPose 最早应用CNN的方法,直接回归关节坐标 S
Flowing ConvNets 热力图->关节点 S
CPM multi-stage和refine heatmap的思想 S
stacked hourglass 卷积层、解卷积层. S
多人姿态估计
DeepCut CVPR2016 《DeepCut: Joint Subset Partition and Labeling for Multi Person Pose Estimation》 S/D
OpenPose Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields S/D
PAF Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields
Mask R-CNN
人体姿态跟踪
3D人体姿态估计

img

数据集:

单人:常见的数据集有MPII, LSP, FLIC, LIP。MPII目前可以认为是单人姿态估计中最常用的benchmark, 使用的是PCKh的指标(可以认为预测的关键点与GT标注的关键点经过head size normalize后的距离)

多人:主要有COCO, 最近有新出一个数据集CrowdPose

Track:PoseTrack

3D : Human3.6M, DensePose

单人姿态估计

Flowing ConvNets

对于当前帧t及相邻的前后n帧使用全卷积网络为每帧输出一个预测的heatmap(去掉FC层),再用光流信息将这些heatmap扭曲到当前帧t。之后将warped的heatmap合并到另一个卷积层中,权衡来自附近框架的扭曲的heatmap。最后使用集合热图的最大值作为关节点。

CPM

Convolution pose machine

CPM是CMU Yaser Sheikh组的工作,后续非常有名的openpose也是他们的工作。从CPM开始,神经网络已经可以e2e的把feature representation以及关键点的空间位置关系建模进去(隐式的建模),输入一个图片的patch, 输出带spatial信息的tensor,channel的个数一般就是人体关键点的个数(或者是关键点个数加1)。空间大小往往是原图的等比例缩放图。通过在输出的heatmap上面按channel找最大的响应位置(x,y坐标),就可以找到相应关键点的位置。

这种heatmap的方式被广泛使用在人体骨架的问题里面。这个跟人脸landmark有明显的差异,一般人脸landmark会直接使用回归(fully connected layer for regression)出landmark的坐标位置。这边我做一些解释。首先人脸landmark的问题往往相对比较简单,对速度很敏感,所以直接回归相比heatmap来讲速度会更快,另外直接回归往往可以得到sub-pixel的精度,但是heatmap的坐标进度取决于在spatial图片上面的argmax操作,所以精度往往是pixel级别(同时会受下采样的影响)。 但是heatmap的好处在于空间位置信息的保存,这个非常重要。一方面,这个可以保留multi-modal的信息,比如没有很好的context信息的情况下,是很难区分左右手的,所以图片中左右手同时都可能有比较好的响应,这种heatmap的形式便于后续的cascade的进行refinement优化。另外一个方面,人体姿态估计这个问题本身的自由度很大,直接regression的方式对自由度小的问题比如人脸landmark是比较适合的,但是对于自由度大的姿态估计问题整体的建模能力会比较弱。相反,heatmap是比较中间状态的表示,所以信息的保存会更丰富。

后续2D的人体姿态估计方法几乎都是围绕heatmap这种形式来做的(3D姿态估计将会是另外一条路),通过使用神经网络来获得更好的feature representation,同时把关键点的空间位置关系隐式的encode在heatmap中,进行学习。大部分的方法区别在于网络设计的细节。先从CPM开始说起。

img

整个网络会有多个stage,每个stage设计一个小型网络,用于提取feature,然后在每个stage结束的时候,加上一个监督信号。中间层的信息可以给后续层提供context,后续stage可以认为是基于前面的stage做refinement。这个工作在MPII上面的结果可以达到88.5,在当时是非常好的结果。

Hourglass

在2016年的7月份,Princeton的Deng Jia组放出了另外一个非常棒的人体姿态估计工作,Hourglass。后续Deng Jia那边基于Hourglass的想法做了Associate Embedding,以及后续的CornerNet都是非常好的工作。

Hourglass相比CPM的最大改进是网络结构更简单,更优美。

img

上图可以看出,网络是重复的堆叠一个u-shape的structure.

img

pipeline上面跟CPM很类似。只是结构做了修改。从MPII上的结果来看,也有明显的提升,可以达到90.9的PCKh。

这种u-shape的结构其实被广泛应用于现代化的物体检测,分割等算法中,同时结果上面来讲也是有非常好的提升的。另外,Hourglass这种堆多个module的结构,后续也有一些工作follow用在其他任务上面。

但是Hourglass也是存在一些问题的,具体可以看后续讲解的MSPN网络。

在CPM以及Hourglass之后,也有很多不错的工作持续在优化单人姿态估计算法,比如[10] [11]。

2016年的下半年还出现了一个非常重要的数据集: COCO。这个时间点也是非常好的时间点。一方面,MPII已经出现两年,同时有很多非常好的工作,比如CPM, Hourglass已经把结果推到90+,数据集已经开始呈现出一定的饱和状态。另外一方面,物体检测/行人检测方面,算法提升也特别明显,有了很多很好的工作出现,比如Faster R-CNN和SSD。所以COCO的团队在COCO的数据集上面引入了多人姿态估计的标注,并且加入到了2016年COCO比赛中,当成是一个track。从此,多人姿态估计成为学术界比较active的研究topic。正如前面我在“问题”的部分描述的,多人姿态估计会分成top-down以及bottom-up两种模式。我们这边会先以bottom-up方法开始描述。

多人姿态估计

DeepCut

DeeperCut

基于deepcut的基础,1. 采用residual net进行body part提取。2. 使用Image-Conditioned Pairwish Terms的方法,压缩候选区。

OpenPose

在2016年COCO比赛中,当时的第一名就是OpenPose [12]。 CMU团队基于CPM为组件,先找到图片中的每个joint的位置,然后提出Part Affinity Field (PAF)来做人体的组装。

img

PAF的基本原理是在两个相邻关键点之间,建立一个有向场,比如左手腕,左手肘。我们把CPM找到的所有的左手腕以及左手肘拿出来建立一个二分图,边权就是基于PAF的场来计算的。然后进行匹配,匹配成功就认为是同一个人的关节。依次类别,对所有相邻点做此匹配操作,最后就得到每个人的所有关键点。

在当时来讲,这个工作效果是非常惊艳的,特别是视频的结果图,具体可以参考Openpose的Github官网。在COCO的benchmark test-dev上面的AP结果大概是61.8。

Keypoint-json

output_overview:

1
CUDA_VISIBLE_DEVICES='1' ./build2/examples/openpose/openpose.bin  --image_dir ./image --write_images ./output_image --write_json ./output_json     --display 0

v1.1-25

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Result for BODY_25 (25 body parts consisting of COCO + foot)
// const std::map<unsigned int, std::string> POSE_BODY_25_BODY_PARTS {
// {0, "Nose"},
// {1, "Neck"},
// {2, "RShoulder"},
// {3, "RElbow"},
// {4, "RWrist"},
// {5, "LShoulder"},
// {6, "LElbow"},
// {7, "LWrist"},
// {8, "MidHip"},
// {9, "RHip"},
// {10, "RKnee"},
// {11, "RAnkle"},
// {12, "LHip"},
// {13, "LKnee"},
// {14, "LAnkle"},
// {15, "REye"},
// {16, "LEye"},
// {17, "REar"},
// {18, "LEar"},
// {19, "LBigToe"},
// {20, "LSmallToe"},
// {21, "LHeel"},
// {22, "RBigToe"},
// {23, "RSmallToe"},
// {24, "RHeel"},
// {25, "Background"}

v1.0-18

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// C++ API call
#include <openpose/pose/poseParameters.hpp>
const auto& poseBodyPartMappingCoco = getPoseBodyPartMapping(PoseModel::COCO_18);
const auto& poseBodyPartMappingMpi = getPoseBodyPartMapping(PoseModel::MPI_15);

// Result for COCO (18 body parts)
// POSE_COCO_BODY_PARTS {
// {0, "Nose"},
// {1, "Neck"},
// {2, "RShoulder"},
// {3, "RElbow"},
// {4, "RWrist"},
// {5, "LShoulder"},
// {6, "LElbow"},
// {7, "LWrist"},
// {8, "RHip"},
// {9, "RKnee"},
// {10, "RAnkle"},
// {11, "LHip"},
// {12, "LKnee"},
// {13, "LAnkle"},
// {14, "REye"},
// {15, "LEye"},
// {16, "REar"},
// {17, "LEar"},
// {18, "Background"},
// }

1574412724600

heatmap order

对于热图存储格式,而不是分别保存67个热图(18个主体部分+背景+ 2 x 19个PAFs),库将它们连接成一个巨大的(宽度x #热图)x(高度)矩阵(即。,由列连接)。例如:列[0,单个热图宽度]包含第一个热图,列[单个热图宽度+ 1, 2 *单个热图宽度]包含第二个热图,等等。注意,一些图像查看器由于尺寸的原因无法显示结果图像。然而,Chrome和Firefox能够正确地打开它们。

PAFs遵循“getposepartpair (const PoseModel PoseModel)”和“getPoseMapIndex(const PoseModel PoseModel)”中指定的顺序。例如,假设COCO(参见下面的示例代码),COCO中的PAF通道从19开始(‘getPoseMapIndex’中最小的数字,等于#body parts + 1),到56结束(最高的一个)。

Hourglass + Associative Embedding

A single-stage,end-to-end way for joint detection and grouping

关节点检测使用stacked hourglass,在原来的基础上每一次下采样时增加输出通道的个数,同时individual layers的残差模型改为3*3的卷积结构,其他结构不变。

在2016年比赛的榜单上面,还有另外一个很重要的工作就是Deng Jia组的Associative Embedding[13]。文章类似Openpose思路,使用bottom-up的方法,寻找part使用了Hourglass的方式来做。关键在于行人的组装上面,提出了Associative Embedding的想法。大概想法是希望对每个关键点输出一个embedding,使得同一个人的embedding尽可能相近,不同人的embedding尽可能不一样。

img

在COCO2016比赛后,这个工作持续的在提升,文章发表的时候,COCO test-dev上面的结果在65.5。

除了Openpose以及Associative Embedding之外,bottom-up还有一个工作非常不错,DeepCut[14]以及DeeperCut[15],他们使用优化问题来直接优化求解人的组合关系。

CPN(18cvpr,stoa)

topdown思路

第一个stage检测可见的easy keypoint,第二个stage专门解决hard keypoint。

后面一部分章节我会重点围绕COCO数据集,特别是COCO每年的比赛来描述多人姿态估计的进展。虽然2016年bottom-up是一个丰富时间点,但是从2017年开始,越来的工作开始围绕top-down展开,一个直接的原因是top-down的效果往往更有潜力。top-down相比bottom-up效果好的原因可以认为有两点。首先是人的recall往往更好。因为top-down是先做人体检测,人体往往会比part更大,所以从检测角度来讲会更简单,相应找到的recall也会更高。其次是关键点的定位精度会更准,这部分原因是基于crop的框,对空间信息有一定的align,同时因为在做single person estimation的时候,可以获得一些中间层的context信息,对于点的定位是很有帮助的。当然,top-down往往会被认为速度比bottom-up会更慢,所以在很多要求实时速度,特别是手机端上的很多算法都是基于openpose来做修改的。不过这个也要例外,我们自己也有做手机端上的多人姿态估计,但是我们是基于top-down来做的,主要原因是我们的人体检测器可以做的非常快。

说完了背景后,在COCO2017年的比赛中,我们的CPN[16]一开始就决定围绕top-down的算法进行尝试。我们当时的想法是一个coarse-to-fine的逻辑,先用一个网络出一个coarse的结果(GlobalNet),然后再coarse的结果上面做refinement (RefineNet)。具体结果如下:

img

为了处理处理难的样本,我们在loss上面做了一定的处理,最后的L2 loss我们希望针对难的关键点进行监督,而不是针对所有关键点uniform的进行监督,所以我们提出了一个Hard keypoint mining的loss。这个工作最后在COCO test-dev达到了72.1的结果 (不使用额外数据以及ensemble),获得了2017年的COCO骨架比赛的第一名。

另外,这个工作的另外一个贡献是比较完备的ablation。我们给出了很多因素的影响。比如top-down的第一步是检测,我们分析了检测性能对最后结果的影响。物体检测结果从30+提升到40+(mmAP)的时候,人体姿态估计能有一定的涨点(1个点左右),但是从40+提升到50+左右,涨点就非常微弱了(0.1-0.2)。另外,我们对data augmentation,网络的具体结构设计都给出了比较完整的实验结果。另外,我们开始引入了传统的ImageNet basemodel (ResNet50)做了backbone,而不是像Openpose或者Hourglass这种非主流的模型设计结构,所以效果上面也有很好的提升。

G-RMI

CVPR 2017《Towards accurate multi-person pose estimation in the wild》

第一阶段使用faster rcnn做detection,检测出图片中的多个人,并对bounding box进行image crop; 第二阶段采用fully convolutional resnet对每一个bonding box中的人物预测dense heatmap和offset; 最后通过heatmap和offset的融合得到关键点的精确定位 (如下)。

1577073795609

RMPE(AlphaPose)

ICCV 2017《REPE: Regional Multi-person Pose Estimation》

现已更新到新版本AlphaPose,效果拔群

在SPPE结构上添加SSTN,能够在不精准的区域框中提取到高质量的人体区域。并行的SPPE分支(SSTN)来优化自身网络。使用parametric pose NMS来解决冗余检测问题,在该结构中,使用了自创的姿态距离度量方案比较姿态之间的相似度。用数据驱动的方法优化姿态距离参数。最后我们使用PGPG来强化训练数据,通过学习输出结果中不同姿态的描述信息,来模仿人体区域框的生成过程,进一步产生一个更大的训练集。

识别姿态使用Stacked Hourglass. 致力于解决对于imperfect proposal,使得crop的person能够被单人姿态估计方法很好的识别,从而克服检测带来的定位误差。第一步获得human proposal第二步是将proposal输入到两个并行的分支里面,上面的分支是STN+SPPE+SDTN的结构,STN接收的是human proposal,SDTN产生的是pose proposal。下面并行的分支充当额外的正则化矫正器。第三步是对pose proposal做Pose NMS(非最大值抑制),用来消除冗余的pose proposal。

1577073834341

参考: AlphaPose论文笔记

MSPN

2018年的COCO比赛中,我们继续沿用top-down的思路。当时我们基于CPN做了一些修改,比如把backbone不停的扩大,发现效果提升很不明显。我们做了一些猜测,原来CPN的两个stage可能并没有把context信息利用好,单个stage的模型能力可能已经比较饱和了,增加更多stage来做refinement可能是一个解决当前问题,提升人体姿态估计算法uppper-bound的途径。所以我们在CPN的globalNet基础上面,做了多个stage的堆叠,类似于Hourglass的结构。

img

相比Hourglass结构,我们提出的MSPN[17]做了如下三个方面的改进。首先是Hourglass的每个stage的网络,使用固定的256 channel,即使中间有下采样,这种结构对信息的提取并不是很有益。所以我们使用了类似ResNet-50这种标准的ImageNet backbone做为每个stage的网络。另外,在两个相邻stage上面,我们也加入了一个连接用于更好的信息传递。最后,我们对于每个stage的中间层监督信号做了不同的处理,前面层的监督信号更侧重分类,找到coarse的位置,后面更侧重精确的定位。从最后效果上面来看,我们在COCO test-dev上面一举跑到了76.1 (单模型不加额外数据)。

HRNet

之前我们讲的很多人体姿态估计方面的工作,都在围绕context来做工作,如何更好的encode和使用这些context是大家工作的重点。到了2019年, MSRA wang jingdong组出了一个很好的工作,提出了spatial resolution的重要性。在这篇工作之前,我们往往会暴力的放大图片来保留更多信息,同时给出更精准的关键点定位,比如从256x192拉大到384x288。这样对效果提升还是很明显的,但是对于计算量的增加也是非常大的。 HRNet从另外一个角度,抛出了一个新的可能性:

img

相比传统的下采样的网络结构,这里提出了一种新的结构分成多个层级,但是始终保留着最精细的spaital那一层的信息,通过fuse下采样然后做上采样的层,来获得更多的context以及语义层面的信息(比如更大的感受野)。从结果上面来看,在COCO test-dev上面单模型可以达到75.5。


到此为止,我们重点讲述了几个多人姿态估计的算法,当然中间穿插了不少我们自己的私货。在多人姿态估计领域还有很多其他很好的工作,因为篇幅问题,这里我们就略过了。

回到2017年,MPI提出了一个新的数据集, PoseTrack,主要是希望能帮忙解决视频中的人体姿态估计的问题,并且在每年的ICCV或者ECCV上面做challenge比赛。 PoseTrack的数据集主要还是来源于MPII的数据集,标注风格也很相近。围绕PoseTrack这个任务,我们重点讲一个工作, Simple Baselines。

Pose Track

Simple Baselines

Simple Baselines [19]是xiao bin在MSRA的工作。提出了一种非常简洁的结构可以用于多人姿态估计以及人体姿态估计的跟踪问题。这里重点讲一下对于PoseTrack的处理方法:

img

这里有两个细节,首先是会利用上一帧的检测结果,merge到新的一帧,避免检测miss的问题。另外,在两帧间,会使用OKS based相似度来做人体的关联,而不是只是简单的使用框的overlap,这样可以更好的利用每个关键点的temporal smooth的性质。从结果上面来看,这个方法也获得了PoseTrack2018比赛的第一名。

到目前位置,我们描述了单人的姿态估计,多人的姿态估计,以及简单讲了一下视频中的人体姿态跟踪的问题。最后,我们讲一下3D人体姿态估计的问题,这个我觉得这个是目前非常active的研究方向,也是未来的重要的方向。

3D 人体姿态估计

  • 3D keypoint (Skeleton)
  • 3D shape (3D surface)
    • Densepose
    • SMPL(参数化人体模型)

2017年deva Ramanan组的一个非常有意思的工作【20】开始说起,3D Human Pose Estimation = 2D Pose Estimation + Matching。从名字可以看出,大致的做法。首先是做2D的人体姿态估计,然后基于Nearest neighbor最近邻的match来从training data中找最像的姿态。2D的姿态估计算法是基于CPM来做的。3D的match方法是先把training data中的人体3d骨架投射到2D空间,然后把test sample的2d骨架跟这些training data进行对比,最后使用最相近的2d骨架对应的3D骨架当成最后test sample点3D骨架。当training数据量非常多的时候,这种方法可能可以保证比较好的精度,但是在大部分时候,这种匹配方法的精度较粗,而且误差很大

也在17年,另外一个非常有意思的工作【21】发表在ICCV2017。同样,从这个工作的名字可以看出,这个工作提出了一个比较simple的baseline,但是效果还是非常明显。方法上面来讲,就是先做一个2d skeleton的姿态估计,方法是基于Hourglass的,文章中的解释是较好的效果以及不错的速度。 基于获得的2d骨架位置,后续接入两个fully connected的操作,直接回归3D坐标点。这个做法非常粗暴直接,但是效果还是非常明显的。在回归之前,需要对坐标系统做一些操作。

从2017年的ICCV开始,已经有工作【22】开始把2D以及3d skeleton的估计问题joint一起来做优化。这样的好处其实是非常明显的。因为很多2d数据对于3d来讲是有帮助的,同时3D姿态对于2d位置点估计也能提供额外的信息辅助。2D的MPII, COCO数据可以让算法获得比较强的前背景点分割能力,然后3D的姿态估计数据集只需要关注前景的3D骨架估计。这也是目前学术界数据集的现状。从实际效果上面来讲,joint training的方法效果确实也比割裂的train 2d以及3d skeleton效果要好。

2018年开始,3D skeleton开始往3d shape发展。

原先只需要知道joint点的3D坐标位置,但是很多应用,比如人体交互,美体,可能需要更dense的人体姿态估计。这时候就有了一个比较有意思的工作densePose 【23】。这个工作既提出来一个新的问题,也包含新的benchmark以及baseline。相比传统的SMPL模型,这个工作提出了使用UV map来做估计(同时间也有denseBody类似的工作),可以获得非常dense的3d姿态位置,等价于生成了3d shape。当然,从3d shape的角度来讲,有很多非常不错的工作,这里就不做重点展开。

最后讲一下3d人体姿态估计目前存在的问题(训练集小,数据鲁棒性不足,Pose固定)。我个人认为主要是benchmark。目前最常使用的human 3.6M实际上很容易被overfit,因为subjects数量太小(实际训练样本只有5-6人,depend on具体的测试方法,测试样本更少)。同时,是在受限的实验室场景录制,跟真实场景差异太大,背景很干净,同时前景的动作pose也比较固定。当然,3d skeleton的数据集的难度非常大,特别是需要采集unconstrained条件下面的数据。目前也有一些工作在尝试用生成的数据来提升结果。

Apply

首先的一个应用是人体的动作行为估计,要理解行人,人体的姿态估计其实是一个非常重要的中间层信息。目前有蛮多基于人体姿态估计直接做action recogntion的工作,比如把关键点当成graph的节点,然后是使用graph convolution network来整合各种信息做动作分类。我博士的研究课题是action recognition,我读完四年博士的一个总结是action这个问题,如果需要真正做到落地,人体姿态估计算法是必不可少的组成部分。

第二类应用是偏娱乐类的,比如人体交互,美体等。比如可以通过3d姿态估计来虚拟出一个动画人物来做交互,使用真实人体来控制虚拟人物。另外比如前一段时间比较火热的瘦腰,美腿等操作背后都可能依赖于人体姿态估计算法。

第三类应用是可以做为其他算法的辅助环节,比如Person ReID可以基于人体姿态估计来做alignment,姿态估计可以用来辅助行人检测,杀掉检测的FP之类的。

SMPL

SMPL 介绍

SMPL模型是一种参数化人体模型,是马普所提出的一种人体建模方法,该方法可以进行任意的人体建模和动画驱动。这种方法与传统的LBS的最大的不同在于其提出的人体姿态影像体表形貌的方法,这种方法可以模拟人的肌肉在肢体运动过程中的凸起和凹陷。因此可以避免人体在运动过程中的表面失真,可以精准的刻画人的肌肉拉伸以及收缩运动的形貌。

该方法中β和θ是其中的输入参数,其中β代表是个人体高矮胖瘦、头身比等比例的10个参数,θ是代表人体整体运动位姿和24个关节相对角度的75个参数。

β参数是ShapeBlendPose参数,可以通过10个增量模板控制人体形状变化: 具体而言:每个参数控制人体形态的变化可以通过动图来刻画:

DensePose

实时人体姿态估计:Dense Pose及其应用展望 -QQnews

基于DensePose的姿势转换系统,仅根据一张输入图像和目标姿势 - 新智元

  • 「人体姿态估计」(human pose estimation)

应用场景:

  • 「密集姿态转移」(dense pose transfer)

Facebook 和 Inria France 的研究人员分别在 CVPR 2018 和 ECCV 2018 相继发表了两篇有关「人体姿态估计」(human pose estimation) 的文章 [1] [2],用于介绍他们提出的 Dense Pose 系统以及一个应用场景「密集姿态转移」(dense pose transfer)。

数据集:

  • DensePose COCO 的大型数据集,包含了预先手工标注的 5 万张各种人类动作的图片。

三点:

(1)利用 Dense Pose 实现单张 2D 人体图像到 3D 表面模型的原理 ;

(2)如何将 Dense Pose 系统应用在「姿态转移」(pose transfer)这一问题上;

(3)粗略展望 Dense Pose 的一些潜在应用。

<1> 2D 图片中描述人体的像素,映射到一个 3D 表面模型

  • 系统架构
  • 工作流程

img

图 1:密集姿态估计的目标是将 2D 图片中描述人体的像素,映射到一个 3D 表面模型。左:输入的原始图像,以及利用 [1] 中提出的 Dense Pose-RCNN,获得人体各区域的 UV 坐标。UV 坐标又称纹理坐标 (texture coordinates), 用于控制 3D 表面的纹理映射; 中:DensePose COCO 数据集中的原始标注;右:人体表面的分割以及 UV 参数化示意图。

密集姿态估计的核心任务是,训练一个深度网络,用于预测 2D 图片像素 (image pixels)与 3D 表面模型点 (surface points) 之间的密集联系 (dense correspondences)。这个任务最近已经通过基于全连接卷积网络 [4] 的 Dense Regression (DenseReg) 系统 [3] 得到了解决。

而 Dense Pose-RCNN 系统 [1],正是结合了 DenseReg 系统以及 Mask-RCNN 架构 [5]。

图2

图 2 展示了 Dense Pose-RCNN 的级连 (cascade) 架构:这是一个全卷积网络 (fully-convolutional network),并连接着 ROIAlign 池化层 (ROIAlign pooling),用于处理两个核心任务,分别是:(1)分类。判断图片的某一像素来自于「背景」,还是「人体部位」;(2)回归。预测该像素在「人体部位」的具体坐标。

图 2 中的 ResNet50 FPN (feature pyramid networks) 将输出 feature map,然后通过 ROIAlign 模块对每一个 ROI 生成固定尺寸的 feature map。

图3

图 3 展示了 ROIAlign 模块的「跨级连」(cross-cascading) 结构,这种结构利用两个辅助任务 (keypoint estimation & mask) 提供的信息,帮助提高 Dense Pose 系统的姿态估计效果。作为 Dense Pose-RCNN 基础之一的 Mask-RCNN [5] 结构,正是借助两个相关任务(即 keypoint estimation 和 instance segmentation)提供的信息,用于提高分割效果。

图 3:Dense Pose-RCNN[1] 中的 ROIAlign 模块采用了「跨级连」(cross-cascading) 架构。

<2>Dense Pose 到「姿态转移」(pose transfer)

应用:「纹理转移」(texture transfer)

ECCV 2018 上,论文 [1] 的三名作者发表了 Dense Pose 的一个后续应用,即「密集姿态转移」(dense pose transfer,以下简称为 DPT) [2]。与纹理转换不同的是,DPT 这一任务的目标是,根据输入的 2D 人体图像和目标姿态 (target dense pose),将输入图像中的人体姿态转换成目标姿态,并且不改变人体表面纹理。

如图 5 所示,DPT 系统以 Dense Pose[1] 为基础,并且由两个互补的模块组成,分别是(1)推测模块 (predictive module),用于根据输入图像,预测出具有目标姿态的人体图像;(2)变形模块 (warping module),负责从输入图像中提取纹理,并「补全」(inpainting) 具有目标姿态的人体表面纹理。此外,系统中还有一个合成模块 (blending module),通过端对端、可训练的单一框架,将推测和变形模块的输出进行合成,并产生最终的图像。

图5

图 5:密集姿态转移(DPT) 系统的流程图。该系统包括推测模块、变形模块,以及合成模块。

<3>展望 Dense Pose

一个应用方向是,利用单一图片进行服装的虚拟试穿

另一个应用方向则是,远程视频诊断背部痛疾。

AMA-net

Figure 2: An illustration of feature extraction on ROIs using different methods. The top and middle demonstrate the existing methods: DensePose R-CNN and Parsing R-CNN. The bottom is our proposed AMA-net.

Figure 3: The framework of our AMA-net. In the added dense pose estimation branch, we propose the Multi-Path Representation learning modular and the Adaptive Path Aggregation modular for exploring the multi-level features. B, BP, SP, U, and V losses denote the losses on body masks, body part masks, surface patches, U coordinates, and V coordinates respectively.

Figure 5: DensePose R-CNN vs AMA-net. Left: input image; middle: DensePose R-CNN; right: AMA-net. The red circles spot the difference between the DensePose R-CNN and AMA-net estimation. The yellow circles mark the positions where both methods fail to estimate UV coordinates.

Figure 5: DensePose R-CNN vs AMA-net. Left: input image; middle: DensePose R-CNN; right: AMA-net. The red circles spot the difference between the DensePose R-CNN and AMA-net estimation. The yellow circles mark the positions where both methods fail to estimate UV coordinates.

  • 从论文的结果看,效果比DensePose的结果更好。

参考Blog

人体姿态估计(Human Pose Estimation)文献综述

论文笔记:Towards accurate multi-person pose estimation in the wild(G-RMI)

refrence 1:

1
2
3
4
5
6
7
8
9
10
11
12
13
[1] Alp Güler, Riza, Natalia Neverova, and Iasonas Kokkinos. "Densepose: Dense human pose estimation in the wild." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018.

[2] Neverova, Natalia, Riza Alp Guler, and Iasonas Kokkinos. "Dense pose transfer." Proceedings of the European Conference on Computer Vision (ECCV). 2018.

[3] Alp Guler, Riza, et al. "Densereg: Fully convolutional dense shape regression in-the-wild." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2017.

[4] Chen, Liang-Chieh, et al. "Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs." IEEE transactions on pattern analysis and machine intelligence 40.4 (2017): 834-848.

[5] He, Kaiming, et al. "Mask r-cnn." Computer Vision (ICCV), 2017 IEEE International Conference on. IEEE, 2017.

[6] Liu, Ziwei, et al. "Deepfashion: Powering robust clothes recognition and retrieval with rich annotations." Proceedings of the IEEE conference on computer vision and pattern recognition. 2016.

[7] Siarohin, Aliaksandr, et al. "Deformable gans for pose-based human image generation." CVPR 2018-Computer Vision and Pattern Recognition. 2018.

refrence 2:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Reference

[1] Randomized Trees for Human Pose Detection, Rogez etc, CVPR 2018

[2] Local probabilistic regression for activity-independent human pose inference, Urtasun etc, ICCV 2009

[3] Strong Appearance and Expressive Spatial Models for Human Pose Estimation, Pishchulin etc, ICCV 2013

[4] Pictorial Structures Revisited: People Detection and Articulated Pose Estimation, Andriluka etc, CVPR 2009

[5] Latent Structured Models for Human Pose Estimation, Ionescu etc, ICCV 2011

[6] Poselet Conditioned Pictorial Structures, Pishchulin etc, CVPR 2013

[7] Learning Human Pose Estimation Features with Convolutional Networks, Jain etc, ICLR 2014

[8] Convolutional Pose Machines, Wei etc, CVPR 2016

[9] Stacked Hourglass Networks for Human Pose Estimation, Newell etc, ECCV 2016

[10] Multi-Context Attention for Human Pose Estimation, Chu etc, CVPR 2017

[11] Deeply Learned Compositional Models for Human Pose Estimation, ECCV 2018

[12] Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields, Cao etc, CVPR 2017

[13] Associative Embedding: End-to-End Learning for Joint Detection and Grouping, Newell etc, NIPS 2017

[14] DeepCut: Joint Subset Partition and Labeling for Multi Person Pose Estimation, Pishchulin etc, CVPR 2016

[15] DeeperCut: A Deeper, Stronger, and Faster Multi-Person Pose Estimation Model, Insafutdinov, ECCV 2016

[16] Cascaded Pyramid Network for Multi-Person Pose Estimation, Chen etc, CVPR 2017

[17] Rethinking on Multi-Stage Networks for Human Pose Estimation, Li etc, Arxiv 2018

[18] Deep High-Resolution Representation Learning for Human Pose Estimation, Sun etc, CVPR 2019

[19] Simple Baselines for Human Pose Estimation and Tracking, Xiao etc, ECCV 2018

[20] 3D Human Pose Estimation = 2D Pose Estimation + Matching, Chen etc, CVPR 2017

[21] A simple yet effective baseline for 3d human pose estimation, Martinez, ICCV 2017

[22] Compositional Human Pose Regression, Sun etc, ICCV 2017

[23] Densepose: Dense Human Pose Estimation in the Wild, Guler etc, CVPR 2018

[24] ThunderNet: Toward Real-time Generic Object Detection, Qin etc, ICCV 2019

[toc]

人体解析数据集 -human parsing

开源 项目
LIP [open] 2017 SS-NAN Single Person http://hcp.sysu.edu.cn/lip
https://github.com/Engineering-Course/LIP_SSL
CIHP [open] 2018 http://sysu-hcp.net/lip/overview.php
ATR [open] 2015
Chictopia10k Co-CNN human parsing “Human parsing with contextualized convolutional neural network.” ICCV’15,
VIP [open] Video Multi-Person Human Parsing
MHP [open] 2017 https://lv-mhp.github.io/dataset
Person-Part [open] 2014 http://www.stat.ucla.edu/~xianjie.chen/pascal_part_dataset/pascal_part.html
Fashionista 2012
DeepFashion
VITON 2017 VITON 闭源;16,253 pairs
MPV 2019 MG-VTON 已经闭源

refer

[引文1]人体解析-human parsing

人体解析-human parsing

研究目标与意义
人体解析是指将在图像中捕获的人分割成多个语义上一致的区域,例如, 身体部位和衣物。作为一种细粒度的语义分割任务,它比仅是寻找人体轮廓的人物分割更具挑战性。 人体解析对于以人为中心的分析非常重要,并且具有许多工业上的应用,例如,虚拟现实,视频监控和人类行为分析等等。

Fashionista 数据集

论文:Parsing Clothing in Fashion Photographs

论文地址:http://www.tamaraberg.com/papers/parsingclothing.pdf

Fashionista

Person-part 数据集

论文:Detect What You Can: Detecting and Representing Objects using Holistic Models and Body Parts

论文地址:http://www.stat.ucla.edu/~xianjie.chen/paper/Chen14cvpr.pdf

数据集地址:http://www.stat.ucla.edu/~xianjie.chen/pascal_part_dataset/pascal_part.html

Person Part

ATR 数据集

论文:Deep Human Parsing with Active Template Regression

论文地址:https://arxiv.org/pdf/1503.02391.pdf

ATR img

LIP数据集

论文:Look into Person: Self-supervised Structure-sensitive Learning and A New Benchmark for Human Parsing

论文地址:https://arxiv.org/pdf/1703.05446.pdf

数据集地址:http://hcp.sysu.edu.cn/lip

代码地址:https://github.com/Engineering-Course/LIP_SSL

img

MHP数据集

论文:Multi-Human Parsing in the Wild

论文地址:https://arxiv.org/pdf/1705.07206.pdf

数据集地址:https://lv-mhp.github.io/dataset

img

CIHP 数据集

论文:Instance-level Human Parsing via Part Grouping Network

论文地址:http://openaccess.thecvf.com/content_ECCV_2018/papers/Ke_

Gong_Instance-level_Human_Parsing_ECCV_2018_paper.pdf

数据集地址:http://sysu-hcp.net/lip/overview.php

代码地址:http://sysu-hcp.net/lip/

img

DeepFashion:

HomePage -Download

​ DeepFashion [38] only have the pairs of the same person in different poses but do not have the image of clothes.

人体解析近年论文:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2018-ECCV-Mutual Learning to Adapt for Joint Human Parsing and Pose Estimation
【MuLA】用于联合人体解析和姿态估计,通过反复利用其并行任务中的指导信息来预测动态任务特定的模型参数

2018-ECCV-Instance-level Human Parsing via Part Grouping Network
【PGN】在一次传递中解析图像中的多个人,将实例级人类解析重新定义为两个可以通过统一网络共同学习和相互提炼的双关联子任务:1)用于将每个像素指定为人体部位(例如,面部,手臂)的语义分割; 2)实例感知边缘检测,以将语义部位分组为不同的人物实例

2018-ECCV-Macro-Micro Adversarial Network for Human Parsing
【MMAN】有两个判别器,一个Macro D用于低分辨率标签图并对语义不一致进行惩罚,例如错位的身体部位。另一个Micro D专注于高分辨率标签图的多个patch,以解决局部不一致性,例如模糊和孔洞

2018-CVPR-Weakly and Semi Supervised Human Body Part Parsing via Pose-Guided Knowledge Transfer
提出了一种获得训练数据的新方法,可以使用人体关键点的数据来生成人体部位解析数据。主要想法是利用人类之间的形态相似性,将一个人的部位解析结果传递给具有相似姿势的另一个人

2017-CVPR-Look Into Person: Self-Supervised Structure-Sensitive Learning and a New Benchmark for Human Parsing
不引入额外信息,可以用自生成的人类关节的信息反过来指导人体解析

2017-CVPR-Learning Adaptive Receptive Fields for Deep Image Parsing Network
一种自动调节深度图像解析网络中感受野的新方法,在网络主干中使用两个仿射变换层并在特征映射上运行

2017-CVPR- Multiple-Human Parsing in the Wild
MH-Parser借助新的Graph-GAN模型以自下而上的方式同时生成全局解析和人物解析

2015-ICCV-Human Parsing with Contextualized Convolutional Neural Network
【Co-CNN】架构,将多级图像上下文集成到一个统一的网络中

[引文2] Dataset Overview [中山大]

1. Overview

Look into Person (LIP) is a new large-scale dataset, focus on semantic understanding of person. Following are the detailed descriptions.

1.1 Volume

The dataset contains 50,000 images with elaborated pixel-wise annotations with 19 semantic human part labels and 2D human poses with 16 key points.

1.2 Diversity

The annotated 50,000 images are cropped person instances from COCO dataset with size larger than 50 * 50.The images collected from the real-world scenarios contain human appearing with challenging poses and views, heavily occlusions, various appearances and low-resolutions. We are working on collecting and annotating more images to increase diversity.

2. Download

2.1 Single Person

We have divided images into three sets. 30462 images for training set, 10000 images for validation set and 10000 for testing set.The dataset is available at Google Drive and Baidu Drive.

Besides we have another large dataset mentioned in “Human parsing with contextualized convolutional neural network.” ICCV’15, which focuses on fashion images. You can download the dataset including 17000 images as extra training data.

2.2 Multi-Person

To stimulate the multiple-human parsing research, we collect the images with multiple person instances to establish the first standard and comprehensive benchmark for instance-level human parsing. Our Crowd Instance-level Human Parsing Dataset (CIHP) contains 28280 training, 5000 validation and 5000 test images, in which there are 38280 multiple-person images in total.

You can also downlod this dataset at Google Drive and Baidu Drive.

2.3 Video Multi-Person Human Parsing

VIP(Video instance-level Parsing) dataset, the first video multi-person human parsing benchmark, consists of 404 videos covering various scenarios. For every 25 consecutive frames in each video, one frame is annotated densely with pixel-wise semantic part categories and instance-level identification. There are 21247 densely annotated images in total. We divide these 404 sequences into 304 train sequences, 50 validation sequences and 50 test sequences.

You can also downlod this dataset at OneDrive and Baidu Drive.

  • VIP_Fine: All annotated images and fine annotations for train and val sets.
  • VIP_Sequence: 20-frame surrounding each VIP_Fine image (-10 | +10).
  • VIP_Videos: 404 video sequences of VIP dataset.

2.4 Image-based Multi-pose Virtual Try On

MPV (Multi-Pose Virtual try on) dataset, which consists of 35,687/13,524 person/clothes images, with the resolution of 256x192. Each person has different poses. We split them into the train/test set 52,236/10,544 three-tuples, respectively.

You can also downlod this dataset at Google Drive or Baidu Drive.
Baidu Drive extract password:
f6i2

引文

引文1:https://blog.csdn.net/wxf19940618/article/details/83661891

引文2: http://www.sysu-hcp.net/lip/overview.php

[toc]

CP-VTON

1807.07688

https://github.com/sergeywong/cp-vton

  • 解决了在真实的虚拟试穿情况下面临的在大空间变形时的服装细节的保留问题。
  • 通过GMM模块整合了全学习的TPS,用来获得更健壮和更强大的对齐图像。
  • 在给定对齐图像的基础上,通过Try-On模块来动态合并渲染结果与变形结果。
  • CP-VTON网络的性能已经在Han等人收集的数据集上进行了证明。

Motivation:

“在保留目标服装细节的情况下将服装转换为适合目标人物的体型”

  • 几何匹配模块GMM,将目标服装转换为适合目标人物体型的形状

  • Try-On模块将变形后的服装与人物整合并渲染整合后的图像

架构

alignment Network 对齐网络

a single pass generative framework 单通道生成框架

1573474568644

GMM模型 几何匹配模块

Geometric Matching Moduel

extracting network:

  • IN_cloth-agnostic_person [h, w, 22] (64, 128, 256, 512, 512 )

  • IN_in_shop_cloth [h, w, 3] (64, 128, 256, 512, 512 )

correlation Matching:

  • 矩阵变换

regression network:

  • CNN (512, 256, 128, 64 )

TPS transformation:

  • TPS 理解

LOSS

  • l1_loss

生成文件

  • warped_cloth
  • warped_mask

1573810852348

Tron-ON Model

GAN:

  • 12-layer UNet(输出Render 和 composite)

MaskComposition:

  • Mask Composition 实现:直接使用 cloth * m_composite + p_rendered * (1 - m_composite)

LOSS

  • L1loss_tryon_im
  • Lvgg_tryon_im
  • L1loss_composition

训练时的Vision

1573810017024

数据转换

原始数据及格式:

image

image_parse

warped_img 【处理image_parse数据二次处理后得到】

Pose【通过OpenPose对refer image处理得到 keypoint文件,二次处理】

Cloth

Cloth-Mask

1573784884416

转换后数据格式:

cloth-agnostic_person(22通道):

  • Pose heatmap: an 18-channel 每个通道对应一个人体姿势关键点(绘制为11×1111×11的白色矩形)。
  • Body shape: a 1-channel 一个1通道的 blurred binary mask 特征图,能够粗糙地包括人体的不同部位。
  • Reserved regions: an RGB image 一个包括面部和头发的RGB图像,用来维持人物身份(保证生成的是同一个人)。
1
2
3
4
5
shape 	 <- image-parse
im_h <- [Regions Part]
pose_map <- [_keypoints.json]

agnostic = [shape, im_h, pose_map]

数据转换-难点理解:

0、VITON

解析VITON数据集合得到的数据有:

1
2
3
4
5
6
'viton_train_pairs.txt': imname, cloth_name
women_top/ ===> cloth
women_top/ +double + imfill + medfilt2 ===> cloth-mask
women_top/ ===> image
/VITON/segment/ + cmap ===> image-parse
/VITON/pose/pkl ===> pose

human_colormap.mat 数据集

1、keypoints文件生成

首先原始数据取自VITON

CP-VTON use the json format for pose info as generated by OpenPose.

我们使用[OpenPose](https://github.com/cmu-computing - lab/openpose)生成json格式的pose信息。

2、Image-Parse文件生成

  • LIP-SSL得到.mat文件, 保存到/VITON/segment/
  • 转换VITON的human_colormap.mat文件得到
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function image_parse()
source_root_dir = 'F:/BaiduNetdiskDownload/viton_resize/train';
iname = '000003_0.jpg';
cname = '000003_1.jpg';

% generate parsing result
im = imread([source_root_dir '/' 'women_top/' imname]);
h = size(im,1);
w = size(im,2);
s_name = strrep(imname,'.jpg','.mat');
segment = importdata([source_root_dir '/' 'segment/' s_name]);
segment = segment';

# 图片裁剪
if h > w
segment = segment(:,1:int32(641.0*w/h));
else
segment = segment(1:int32(641.8*h/w),:);
end
segment = imresize(segment, [h,w], 'nearest');

segment = imresize(segment, [fine_height, fine_width], 'nearest');

% save parsing result
segment = uint8(segment);
pname = strrep(imname, '.jpg', '.png');
imwrite(segment,cmap,[target_root_dir '/' mode '/image-parse/' pname]);
end

3、Cloth-Mask文件生成

cloth 文件生成

1
2
3
4
5
6
7
8
9
10
11
function conver_data()
source_root_dir = 'F:/BaiduNetdiskDownload/viton_resize/train';
cname = '000003_1.jpg';
target_root_dir = 'F:/BaiduNetdiskDownload/viton_resize_qs/train';
im_c = imread([source_root_dir '/' 'cloth/' cname]);
% save cloth mask
mask = double((im_c(:,:,1) <= 250) & (im_c(:,:,2) <= 250) & (im_c(:,:,3) <= 250));
mask = imfill(mask);
mask = medfilt2(mask);
imwrite(mask, [target_root_dir '/cloth-mask/' cname]);
end

4、Body shape裁剪 [训练时转换]

5、保留区域的转换 [训练时转换]

6、Pose heatmap 生成

ViTON- 采用OpenPose开源库,直接从源文件img生成。

Reference:

论文笔记MG-VTON

[TOC]

VTON code

1711.08447 [VITON] An Image-based Virtual Try-on Network.pdf

VITON:基于映像的虚拟试穿网络

CVPR 2018论文“ VITON:基于图像的虚拟试穿网络”的代码和数据集

人像提取

本文中使用的人物表示由2D姿态估计器和人工解析器提取:

数据集

由于版权问题,该数据集不再公开可用。对于已经下载数据集的用户,请注意,使用或分发数据集是非法的!

This dataset is crawled from women’s tops on Zalando.

测试

第一阶段

Google云端硬盘上下载经过预训练的模型。将它们放在model/文件夹下。

运行test_stage1.sh以进行推断。结果在中results/stage1/images/results/stage1/index.html可视化结果。

第二阶段

运行matlab脚本shape_context_warp.m以提取TPS转换控制点。

然后test_stage2.sh进行优化并生成最终结果,该结果位于中results/stage2/images/results/stage2/index.html可视化结果。

培养

准备数据

往里走prepare_data

首先运行extract_tps.m。这将需要一些时间,您可以尝试并行运行它,也可以直接通过Google云端硬盘下载预先计算的TPS控制点,然后将其放入data/tps/

然后运行./preprocess_viton.sh,生成的TF记录将位于中prepare_data/tfrecord

第一阶段

train_stage1.sh

第二阶段

train_stage2.sh

引文

如果此代码或数据集有助于您的研究,请引用我们的论文:

1
2
3
4
5
6
@inproceedings{han2017viton,
title = {VITON: An Image-based Virtual Try-on Network},
author = {Han, Xintong and Wu, Zuxuan and Wu, Zhe and Yu, Ruichi and Davis, Larry S},
booktitle = {CVPR},
year = {2018},
}

https://github.com/xthan/VITON

Paper Viton[札记]

VITON用一个由粗到细的框架解决了这个问题,并期望通过TPS变形来捕捉布料的变形。

An overview of VITON.

1573543133654

VITON Paper:

VITON 的目标在于,对给定的参考图像(模特)I和目标衣服c,生成合成图像I霸;I霸中c被自然地“穿”到参考图像I中模特对应的区域上,而模特的姿势和其他身体部位特征被保留。最直接的方法是用这样的训练集:同一个模特(姿势和人体特征相同)穿着不同衣服的多张图片和对应的这些衣服的产品图。但是这种数据集是很难大规模得到的。
在实际虚拟试衣场景中,在测试时只有参考图像和目标产品的图像是可以得到的。因此,我们把这种设定同样运用到训练集中来,所以输入的参考图像I中模特穿的衣服就是目标衣服c,这样的数据集是易得的(就像某宝上卖衣服,不仅给产品图还要给卖家秀)。那么现在的重点就是,给定c和模特人体信息,怎么训练一个网络->不仅可以生成合成图像,更重要的是要在测试中能够泛化,用任意所需的服装项目合成感知上令人信服的图像。

3. Person Representation 人体特征表示

3.1 Pose heatmap 姿势热图

人体姿势的多样性导致了衣服不同程度的变形,因此我们使用最先进的姿势估计器明确地建模姿势信息。(用的是CVPR2017的人体姿势估计Realtime Multi-Person Pose Estimation)人体姿势估计包含了18个关键点,为了使Represent表示的各个部分可以空间堆叠,每个关键点被转换成热图heatmap,在关键点附近有一个11×11的邻居填充了1, 在其他地方填充0,然后把这些热图堆叠成一个18通道的姿势热图。

  • Realtime Multi-Person Pose Estimation –》姿态信息, 18个关键点
3.2 Human body representation 人体身体部位表示

衣服的外形很大程度上取决于人的形状(高矮胖瘦),因此如何将目标衣服进行变形取决于不同的身体部位(如手臂,躯干)和身体形态。一个先进的人体解析的方法(LIP-SSL,个人感觉LIP-SSP比较难跑,caffe环境配置复杂,建议跑它的另一个版本JPPNet,不过要是想得到.mat要自己改一下输出)输出人体分割图(.mat格式,不同分割区域标记了不同编号)。然后我们把这个分割图转换成一个单通道的二进制掩模,其中1代表身体部分,0表示其他部位。这个二进制掩模呗下采样成一个低分辨率的图(16*12),当身体形状和目标衣服混淆时,避免伪影。

  • LIP-SSL 人体解析算法,生成人体分割图.mat文件
  • JPPNET(option)
3.3 Face and hair segment 脸部、头发的分割

为了维持人本身的特点,我们在人体表示中融入了身体特征,如脸、肤色、头发之类。我们用Human body representation里一样的人体解析器分离出人脸和头发部分的RGB图,作为新合成图像的身份信息。

  • LIP-SLL 分离人脸和头发部分的RGB图

Pose + Body + Face == (18 + 1 + 3)

最后,把以上得到的三个部分转换到统一分辨率,然后堆叠形成与衣物无关的人体表示P(256,192,22),示意图如下。P包含了丰富的人体信息,convNet就是基于这些信息学习它们之间的关系,比以往的person Presentation都精细。
在这里插入图片描述

Multi-task Encoder-Decoder Generator -> Gc

输入:Person Representation P和目标衣服Target Clothing C
输出:粗合成I’和对应区域掩模M
Gc:这里用到的编码解码框架是一种包含连接跳跃skip connections的U-net网络结构。
设Gc为编码解码器估计的方程,它将P和C组合作为输入并输出四通道(I‘和M)结果。我们希望得到一个生成器,使得粗合成图I’尽可能接近参考图I,掩模M尽可能接近从参考图I模特上预测得到的伪ground truth掩模M0。一个简单的方法就是用L1损失,使当输出目标是M0这样的二进制掩模时,它会产生不错的结果。但是如果输出要是RGB图像的话,L1 Loss就会使输出图像变模糊。我们还引入了a perceptual loss感知损失。下式是感知损失的和以及LI Loss加和的结果。
在这里插入图片描述
网络用ImageNet数据集训练的VGG19权重初始化。超参数lamda_i控制第i层的贡献。第一个Stage的Gc没有学习细节(L1 Loss导致),所以得到的是粗合成图。

Refinement Network -> GR

是为了从目标衣服产品图中学习对应模糊图像区域的细节并恢复。

Warped clothing item 衣服变形

为了运用目标衣服产品图中的纹理细节,要先对衣服进行变形。

a thin plate spline (TPS) transformation

copy from

VITON_realtime

Dataset

The dataset can be downloaded on Google Drive.

This dataset is crawled from women’s tops on Zalando. These images can be downloaded on Google Drive. The results of pose estimation and human parsing are also included. Note that number of the images/poses/segmentation maps are more than that reported in the paper, since the ones with bad pose estimations (too few keypoints are detected) or parsing results (parsed upper clothes regions only occupy a small portion of the image).

Put all folder and labels in the data folder:

data/women_top: reference images (image name is ID_0.jpg) and clothing images (image name is ID_1.jpg). For example, the clothing image on reference image 000001_0.jpg is 000001_1.jpg. The resolution of these images is 1100x762.

data/pose.pkl: a pickle file containing a dictionary of the pose keypoints of each reference image. Please refer to this demo for how to parse the stored results, and OpenPose output to understand the output format. (字典文件保存:(pose keypoints, image)pose keypoints of each reference image)

包含每个参考图像的位姿关键点字典的pickle文件。请参考这个演示如何解析存储的结果,和OpenPose输出来理解输出格式。

data/pose/: folder containing the pose keypoints of each reference image.

data/segment: folder containing the segmentation map of each reference image. In a segmentation map, label 5 corresponds to the regions of tops (used as pseudo ground truth of clothing region). label 1 (hat), 2 (hair), 4 (sunglasses), and 13 (face) are merged as the face/hair representation. All other non-background regions are merged for extracting the body representation. The colormap for visualization can be downloaded here. Due to padding operations of the parser, these segmentation maps are 641x641, you need to crop them based on the aspect ratio of the original reference images.

data/tps/: TPS control points between product image and its corresponding reference image.

data/viton_train_images.txt: training image list.

data/viton_train_pairs.txt: 14,221 reference image and clothing training image pairs.

data/viton_test_pairs.txt: 2,032 reference image and target clothing testing image pairs. Note that these pairs are only used for the evaluation in our paper, one can choose any reference image and target clothing to generate the virtual try-on results.

问题1:(人体解析)segment的数据来源

​ LIP-SSL 人体解析,分离人脸,发等特征

问题2:(姿态评估)pose.pkl 文件格式,如何生成

​ see ##3.1. Person Representation

​ reference images的pose keypoints

​ Realtime_Multi-Person_Pose_Estimation 模型得到的人体姿态评估 18通道

问题3:(人体分割)pose结果的格式

​ LIP_SSL得到的人体Shape .mat 文件

问题4:pose keypoints文件的来源

​ 见问题3

问题5:tps的数据格式

替代技术选型:

Human Parse: SS-NAN

Pose Estimator: TF-pose-estimation

RUN (How to run?)

  1. Download related models
  • Download pretrained SS-NAN model here. Put AttResnet101FCN_lip_0023.h5 under SS-NAN/ folder.

  • Model of tf-pose-estimation is already in the repo since it could use mobile-net.

  • Download pretrained VITON models on Google Drive. Put them under model/ folder.

  1. For remote server with GPU support, run the below for API server to deal with pose and segmentation inferrence:

    1
    2
    3
    conda env create -f environment.yml
    source activate MakeNTU
    bash run_API_server.sh
  2. For local server, run the below to do VITON inferrence and avoid tensorflow session problem for concurrency:

    1
    2
    3
    4
    conda env create -f environment.yml
    source activate MakeNTU
    export FLASK_APP=VITON_local_server.py
    flask run
  3. Change settings in VITON_Demo_post:
    Set VIDEO_SOURCE to your webcam number or video path.

  4. Finally, run the main app:

    1
    2
    3
    4
    5
    export SEG_SERVER=<IP address ofthe remote server, like http://192.168.0.123:8000>
    export POSE_SERVER=<IP address ofthe remote server, like http://192.168.0.123:8000>
    export VITON_SERVER='http://localhost:5000'
    source activate MakeNTU
    python VITON_Demo_post.py

Keyboard controls

1
2
3
q: to exit
c: to capture image and do virtual try-on
a/s/d/f: change clothes to try on

Other files are for running all things locally or without concurrency.

One could also run python post_viton.py to run without local VITON server.

[TOC]

MG-VTON 《Towards Multi-pose Guided Virtual Try-on Network 》

https://arxiv.org/abs/1902.11026

Virtual try-on system 虚拟试穿系统。

—现有的方法,只能从单个固定的人体姿态上换装。往往失去纹理细节,缺少姿态多样性。

three Stages:

  1. a desired human parsing map of the target image is synthesized to match both the desired pose and the desired clothes shape; 合成目标图像的所需人工解析映射,以匹配所需的姿态和所需的衣服形状

  2. a deep Warping Generative Adversarial Network (Warp-GAN) warps the desired clothes appearance into the synthesized human parsing map and alleviates the misalignment problem between the input human pose and desired human pose; 深度扭曲生成对抗网络(Warp-GAN)将期望的服装外观扭曲到合成的人体解析图中,解决了输入人体姿态与期望人体姿态之间的错位问题

  3. a refinement render utilizing multi-pose composition masks recovers the texture details of clothes and removes some artifacts. Extensive experiments on well-known datasets and our newly collected largest virtual try-on benchmark demonstrate that our MGVTON significantly outperforms all state-of-the-art methods both qualitatively and quantitatively with promising multipose virtual try-on performances. 使用多姿态合成蒙版的细化渲染恢复衣服的纹理细节,并删除一些人工制品.在知名数据集上的大量实验和我们新收集的最大的虚拟试测基准表明,我们的MGVTON在定性和定量上都显著优于所有最先进的方法,具有很有前途的多姿态虚拟试测性能。

Key:

数据(人工标记):姿态,衣服形状

数据集: well-know【DeepFashion】 & self conllected largest

网络架构:Warp-GAN

技术储备:多姿态合成蒙版(一种利用多姿态合成掩模来恢复纹理细节和减少伪影的细化网络)

Apply: 虚拟试穿、虚拟现实和人机交互

Other exiting works [14, 20, 35] usually leverage 3D measurements to solve those issues since the 3D information have abundant details of the shape of the body that can help to generate the realistic results. However, it needs expert knowledge and huge labor cost to build the 3D models, which requires collecting the 3D annotated data and massive computation. These costs and complexity would limit the applications in the practical virtual try-on simulation. 3D建模,这些费用和复杂性限制了虚拟试验仿真的实际应用。

Dataset:

MPV:

​ collect from the internet, named MPV ;

​ contains 35,687 person images and 13,524 clothes images.

​ The image is in the resolution of 256 × 192. We extract the 62,780 three-tuples of the same person in the same clothes but with diverse poses .

​ 图片大小265x192,提取了62780组图片,每组含同一人的不同姿势的三张图片。

MG_VTON

Picture + clothes + pose -> 穿新衣的人物Pose照片

MG-VTON 四个组成部分:

1- a pose-clothes-guided human parsing network is designed to guide the image synthesis; 设计了一种基于服装姿态引导的人工解析网络来指导图像合成;

2- a Warp-GAN learns to synthesized realistic image by using a warping features strategy。GAN学习合成真实图像。

3- a refinement network learns to recover the texture details

4- a mask-based geometric matching network is presented to warp clothes that enhances the visual quality of the generated image 提出了一种基于掩模的几何匹配网络,通过对衣服的变形来提高图像的视觉质量。

我们采用了一个“粗-精”策略,将这个任务分成三个子任务,three subtasks :

  • conditional parsing learning,(条件解析学习)

  • the Warp-GAN,

  • the refinement render. (细化纹理)

OverView MG-VTON

姿态编码:使用pose estimator [4] ,我们将姿态编码为18个热图,其中填充一个半径为4像素的圆,其他地方为0。

使用人解析器[6]来预测由20个标签组成的人类分割地图,从中提取面部、头发和身体形状的二进制掩码

根据VITON[8],我们将身体形状的采样降低到一个较低的分辨率(16×12),并直接将其调整到原始分辨率(256×192),这减轻了由于身体形状的变化所造成的人为影响

1573117982297

Architecture

3.1. Conditional Parsing Learning 【~人体解析/语义分割】

1573203694348

L1-loss 产生更平滑的结果

softmax_loss 合成高质量的人工Parsing Map

IN: (ImageOfClothes, postHeatMap, body shape, mask Hair, mask Face)

p(St’|(Mh, Mf, Mb, C, P))

G: 该阶段基于条件生成对抗网络(CGAN)

D: We adopt the discriminator D directly from the pix2pixHD

OUT: Parsing

3.2. Warp-GAN 【~Fake】

1573203679896

[geometric matching](《Convolutional neural network architecture for geometric matching》) module to warp clothes image3.4

3.3. Refinement render 【~高像素修复】

1573203710267

3.4. Geometric matching learning 【~】

1573203724114

Implementation Detail:

Setting. We train the conditional parsing network, WarpGAN, refinement render, and geometric matching network for 200, 15, 5, 35 epochs, respectively, using ADAM optimizer [13], with the batch size of 40, learning rate of 0.0002, β1 = 0:5, β2 = 0:999. We use two NVIDIA Titan XP GPUs and Pytorch platform on Ubuntu 14.04.

Architecture.

each generator of MG-VTON is a ResNet-like network, which consists of three downsample layers, three upsample layers, and nine residual blocks, each block has three convolutional layers with 3x3 filter kernels followed by the bath-norm layer and Relu activation function.

64, 128, 256, 512, 512, 512, 512, 512, 512, 512, 512, 512, 256, 128, 64.

discriminator we apply the same architecture as pix2pixHD [30], which can handle the feature map
in different scale with different layers. Each discriminator contains four downsample layers which include 4x4 kernels, InstanceNorm, and LeakyReLU activation function.

相关技术

GAN

Person image synthesis (人像合成)

骨架辅助[32]提出了一种骨架导向的人体图像生成方法,该方法以人体图像和目标骨骼为条件。

PG2[17]应用了由粗到细的框架,包括粗级和精级。novel model [18] to further improve the quality of result by using a decomposition strategy(分解策略)

deformableGANs[27]和[1]分别在粗糙矩形区域使用仿射变换和在pixellevel上对零件进行翘曲,试图缓解不同位姿之间的错位问题

V-UNET[5]引入了一个变化的U-Net[24],通过用stickman标签重组形状来合成人的图像

[21]直接应用CycleGAN[36]进行位姿操作

However, all those works fail to preserve the texture details consistency corresponding with the pose. 然而,所有这些作品都未能保持与姿态相对应的纹理细节的一致性。

The reason behind that is they ignore to consider the interplay between the human parsing map and the pose in the person image synthesis。

这背后的原因是他们忽略了人解析映射和人图像合成中的姿态之间的相互作用。

人体解析图可以指导生成器在精确的区域级合成图像,保证了人体结构的一致性

Virtual try-on.

fiexd pose:

VITON[8] computed the transformation mapping by the shape context TPS warps [2]

CP-VTON[29] 估计变换参数的学习方法。

FanshionGAN[37] 学会了在输入图像的基础上生成新衣服,这个人以描述不同衣服的句子为条件

ClothNet[15]提出了一种基于图像的生成模型,根据颜色生成新衣服。

CAGAN[10]提出了一个条件类比网络来合成以衣服配对为条件的人的图像,这限制了实际的虚拟试穿场景。

ClothCap[20]利用3D扫描仪自动捕捉衣服和身体的形状

[26]提出了一种需要三维人体形态的虚拟试衣系统,对注释的采集十分繁琐。

—-learning to synthesize image with the new outfit on the person through adversarial learning , which can manipulate the pose simultaneously.

—-使用对抗学习用新衣服合成图像, 同时控制姿势

[toc]

Contract Bridge

trick-taking card game .

由一个叫牌阶段和一个打牌阶段组成

opponent(s) and partner


规则:同Skat类似分两个阶段,叫分和出牌阶段

4人,两两一组,没人13张牌,共计52张

打13轮,每轮一张(与Skat的出牌规则一致),赢一轮则称之为赢一墩。基本局要赢6墩。

无将(最高)、黑桃、红桃、方片、梅花(最低)

叫分:NT; 1H(赢7墩), 2C(赢8墩)…

出牌:同花色比大小,(有将牌,奖牌大);最大队赢一墩。

GIB

Not Plan or mimic human

PIMC, a brute force approach

PIMC:

当PIMC玩家move时,我们先创建一个虚拟的世界,对所有未观察到的变量赋值(当前游戏状态下)。

然后当成完全信息游戏PK。repeat 多次,选择平均效用最高的move。


strategy fusion

non-locality

Paper : GIB

Paper :The State of Automated Bridge Play

Paul M Bethe, NYU 2010

Paper : Automatic Bridge Bidding Using Deep Reinforcement Learning

使用Q-Learning进行叫牌。

1572512512141

算法: 不考虑竞争?

1572509442777

Paper : Competitive Bridge Bidding with Deep Neural Networks

基于神经网络构建叫牌系统的方法。

桥牌游戏分为叫牌和打牌两个阶段。对计算机程序来说,虽然打牌相对容易,但叫牌是非常具有挑战性的。在叫牌阶段,每个玩家只知道自己牌,但同时,他需要在对手的干扰下与搭档交换信息。现有的解决完全信息博弈的方法不能直接应用于叫牌中。大多数桥牌程序都是基于人工设计的规则,但是,这些规则并不能覆盖所有的情况,而且,它们通常模棱两可甚至相互矛盾。本文首次提出了一种基于深度学习技术的叫牌系统,在文中,我们展示了两个创新点。首先,我们设计了一个紧凑的表示,对私人和公共信息进行编码,供玩家投标。第二,在分析其他玩家的未知牌对最终结果的影响的基础上,设计了两个神经网络来处理不完全信息,第一个神经网络推断出搭档的牌,第二个神经网络将第一个神经网络的输出作为其输入的一部分来选择叫牌。实验结果表明,我们的叫牌系统优于基于规则的最优方案。

思路:

​ 预测队友的牌来缩小信息集,从而降低结果的不确定性。

​ SL + RL(Self-Play); 同一个团队的 2 个智能体会通过不断修正对队友牌面的预测准确性来保持信息交换和协作,同时与自己的历史版本对抗,在不断的学习中提升自己的胜率。

项目设计:

​ PI: 自己的牌,局况,叫牌序列

​ in-PI: 队友牌的预测

​ ENN: ($c_p,v, h, c_p+$); label $c_p+$ contains 13 ones and 39 zeros; sigmoid(52); 推断出搭档的牌

​ PNN: ($c_p, v, h, ϕ_w, (c_p, v, h), b_p$) ; softmax(39); 选择叫牌

算法:

1572429108140

成果:

​ 在叫牌阶段超越了当前版本的 Wbridge5

Reference

《Search, Inference and Opponent Modelling in an Expert-Caliber Skat Player》

《GIB: Imperfect Information in a Computationally Challenging Game.》 M. Ginsberg. Journal
of Artificial Intelligence Research, pages 303–358, 2001.

《The State of Automated Bridge Play 》Paul M Bethe, NYU 2010

《Automatic Bridge Bidding Using Deep Reinforcement Learning 》Chih-Kuan Yeh 2016

《Competitive Bridge Bidding with Deep Neural Networks∗》Jiang Rong arxiv AAMAS 2019 的 140 篇入选论文; 论文采访解读

[toc]

DeepStack

1571971584952

图 1:HUNL 中公开树的一部分。

1571971689058

图2:DeepStack架构:

A: 公共树的推理,action probabilities for all cards

B: evaluation function: 使用NN,该网络以当前迭代的公开状态和范围作为输入,然后输出两个玩家的反事实价值。

C: 随机生成poker situations(pot size, board cards, ranges),生成训练样本,供NN训练。

Continual re-solving 持续解决

Limited depth lookahead via intuition 通过直觉实现有限深度前瞻

Sound reasoning 合理推理

DeepStack的深度有限的连续重算是可靠的。如果DeepStack的直觉是“好的”, 并且在每一个重新求解的步骤中都使用了“足够的”计算,那么DeepStack就扮演了一个任意接近于纳什均衡的近似。

Sparse lookahead trees 稀疏前瞻树

reduction in the number of actions.

Relationship to heuristic search in prefect information games

Relationship to abstraction-based approaches

Deep Counterfactual Value Networks

Architecture & Train:

两个NN;

Flop Network: 1 million randomly generated flop games.

Turn Network: 10 million randomly generated poker turn games.

一个辅助网络;在处理任何公共卡之前,使用一个辅助的值网络来加速早期动作的重新求解

1571911214323

输入:池底大小,公共牌,手牌范围(Player Card ranges)=> hand clusters。

输出:Zero-sum; Conterfactual values。

Evaluating DeepStack

1571992324228

Online

DeepStack 会在游戏的每一个节点重新计算一小段可能性的树,而不是提前算出整个博弈树。

Algorithm

1571971177717

1571971190822

1571971204916

reference

重磅 | Science论文详解击败德扑职业玩家的DeepStack,Nature探讨其与Libratus的优劣

Pluribus Science论文解读:打牌一时爽,一直打牌一直爽

[TOC]

Papers:

2015 SFP《Fictitious self-play in extensive-form games》 Heinrich et al. (2015) UCL&&DeepMind

2016 [NFSP]《Deep Reinforcement Learning from Self-Play in Imperfect-Information Games 》 UCL: Johannes Heinrich

2019 [MC-NFSP]《Monte Carlo Neural Fictitious Self-Play: Approach to Approximate Nash Equilibrium of Imperfect-Information Games? 》 ZJU: Li Zhang

Background:

Extensive-form Game:

​ 扩展形式游戏是一种涉及多个代理的顺序交互模型

博弈论中,与正则形式相应,扩展形式(英语:Extensive-form game)通过来描述博弈。每个节点(称作决策节点)表示博弈进行中的每一个可能的状态。博弈从唯一的初始节点开始,通过由参与者决定的路径到达终端节点,此时博弈结束,参与者得到相应的收益。每个非终端节点只属于一个参与者;参与者在该节点选择其可能的行动,每个可能的行动通过从该节点到达另一个节点。wiki

Normal-form Game

博弈论中,正则形式(Normal-form game)是描述博弈的一种方式。与延展形式不同,正则形式不用图形来描述博弈,而是用矩阵来陈述博弈。与延展形式的表述方式相比,这种方式在识别出严格优势策略纳什均衡上更有用,但会丢失某些信息。博弈的正则形式的表述方式包括如下部分:每个参与者所有显然的和可能的策略,以及和与其相对应的收益。

FP (Fictitious play )

1571629669702

​ 双玩家零和和潜在游戏

RL-分类

on-policy: An agent is learning on-policy if it gathers these transition tuples by following its own policy.(从自己的策略中学习)

off-policy: In the off-policy setting an agent is learning from experience of another agent or another policy. (从其它agent的经验中学习)

​ eg: Q-learning

3. Extensive-Form Fictitious Play

In this section, we derive a process in behavioural strategies that is realization equivalent to normal-form fictitious play (我们推导出行为策略的一个过程,即实现等同于正常形式的虚拟游戏)

下面的引理(Theorem6)显示了如何通过一个加权组合的实现等价的行为策略来实现标准形式策略的混合。

RL-算法pseudo-code

XFP

( full-width extensive-form fictitious play) : 通过Theorem7更新Behavioural Strategy,可以收敛到纳什均衡。

1、计算best Respose

2、更新策略,使用theorem 7

repeat

1571128998813

FSP(Fictitious Self-Play):

  • 使用强化学习计算BestResponse
  • 使用监督学习更新策略

1571129034224

NFSP:

  • 引入Neural Network近似; 替代传统算法:强化学习和监督学习都使用神经网络拟合。
  • Policy Network Π
  • Action-Value Network Q

1571126251481

MC-NFSP:

训练时,采用 $\eta$-greed 的概率进行policy的选择

  • 1-$\eta$ 时,Policy Network $\Pi$
  • $\eta$ 时,Policy-Value Network B 结合MCTS,选择最佳策略

1571126325514

1571126340205

引申:

Neural Fictitious Self Play——从博弈论到深度强化学习 腾讯云

[从Fictitious Play 到 NFSP](https://gyh75520.github.io/2017/07/27/从Fictitious Play 到 NFSP/)

[toc]

ML损失函数

0-1损失函数

$$
L(Y, f(X)) = \begin{cases}
1, Y \neq f(X) \
0, Y = f(X)
\end{cases}
$$

$$
L(Y, f(X)) = \begin{cases}
1 , |Y - f(X)| \geq T \
0 , |Y = f(X)| < T
\end{cases}
$$

绝对值损失函数

$$
L(Y, f(X)) = |Y - f(X)|
$$

平方损失函数

实际结果和观测结果之间差距的平方和,一般用在线性回归中,(与最小二乘法应用场景类似)
$$
L(Y, f(X)) = \sum_{i=1}^{N} (y_i-f(x_i))^2
$$

对数损失函数

主要在逻辑回归中使用,样本预测值和实际值的误差符合高斯分布,使用极大似然估计的方法,取对数得到损失函数:

$$
L(Y, P(Y|X)) = -logP(Y|X)
$$
对数损失函数包括entropy和softmax,一般在做分类问题的时候使用(而回归时多用绝对值损失(拉普拉斯分布时,μ值为中位数)和平方损失(高斯分布时,μ值为均值))

指数损失函数

$$
L(Y|f(X)) = \exp(-yf(x))
$$

铰链损失函数

主要用在SVM中,Hinge Loss的标准形式为:

$$
L(y) = max(0, 1-ty)
$$

Keras / TensorFlow 中常用 Cost Function 总结

  • mean_squared_error或mse
  • mean_absolute_error或mae
  • mean_absolute_percentage_error或mape
  • mean_squared_logarithmic_error或msle
  • squared_hinge
  • hinge
  • categorical_hinge
  • binary_crossentropy(亦称作对数损失,logloss)
  • sigmoid_cross_entropy
  • softmax_cross_entropy
  • sparse_softmax_cross_entropy
  • logcosh
  • categorical_crossentropy:亦称作多类的对数损失,注意使用该目标函数时,需要将标签转化为形如(nb_samples, nb_classes)的二值序列
  • sparse_categorical_crossentrop:如上,但接受稀疏标签。注意,使用该函数时仍然需要你的标签与输出值的维度相同,你可能需要在标签数据上增加一个维度:np.expand_dims(y,-1)
  • kullback_leibler_divergence:从预测值概率分布Q到真值概率分布P的信息增益,用以度量两个分布的差异.
  • poisson:即(predictions - targets * log(predictions))的均值
  • cosine_proximity:即预测值与真实标签的余弦距离平均值的相反数