概述
项目主页:https://www.mmlab-ntu.com/project/meshinversion/ 方法名称:MeshInversion 输入:单目图像 (in the wild,有背景的,没有抠图的) 输出:textured 3D mesh key challenge: 缺少3D或multiview supervision 方法核心:先预训练一个3D GAN ,可以从latent code z生成textured mesh。然后在inference的时候,从输入的图片倒推最符合的z。(这是一个inferece optimization的方法!! )
Related Work
Single View 3D Reconstruction
image-3D object pairs [46,35,32,39] multi-view images [33,28,51,47,34] SMPL for humans and 3DMM for faces [8,40,18],
CMR [19] reconstructs categoryspecific textured mesh
texture一般有两种方法,一个是direct regression of pixel values in the UV texture map – often blurry 但作者用的这个。 主流方法是learning the texture flow。
GAN inversion
textured mesh generation
6.Learning to predict 3D objects with an interpolation-based differentiable renderer. In: NeurIPS (2019) 重建的mesh可微渲染之后,用渲染得到的multi view images做discriminaive 监督
13.Leveraging 2D data to learn textured 3D mesh generation. In: CVPR (2020) VAE 方法,face colors instead of texture maps
38.Convolutional generation of textured 3D meshes topology-aligned texture maps and deformation maps in the UV space. (本文就用了他的pretrained model)
Method
看起来大体方法是用Generator从latent code生成geometry和texture,然后用chamfer mask loss和chamfer texture loss来监督。
Preliminaries
mesh表示为O = (V,F,T), 即点,面,texture map。 其中,由于
An individual mesh is iso-morphic to a 2-pole sphere.
因此点的位置可用球体的deformation ΔV\Delta \mathbf{V}ΔV表示: V=Vsphere+ΔV\mathbf{V} = \mathbf{V}_{sphere} + \Delta \mathbf{V}V=Vsphere+ΔV 以前的方法大多用MLP来regress delta V,本文使用CNN。
渲染是,使用弱透视投影。(区别于透视投影和正交投影的一种投影方法),参数为π, 包含scale s, translation t和rotation r。
3.1 Reconstruction with Generative Prior
Pre-training Stage
这个阶段训练了一个3D GAN。主要参考ConvMesh和PatchGAN。
Inversion Stage
目的:find the z that best recovers the 3D object from the input image Iin\mathbf{I}_{in}Iin.
需要:原始的image,其对应的mask,还有将3Dshape进行渲染的相机参数。
其中mask 用现成的segmentation tool (PointRend)来获取。 理由在此:https://github.com/junzhezhang/mesh-inversion/issues/5 是为了fair comparison以及强调这是test time optimization shape用的latent code z和渲染用的相机参数π用本文的网络来预测。也就是mesh用ConvMesh,相机用CMR。 如何预测相机参数π:如果直接regress camera pose from scratch,存在camera-shape ambiguity问题。[24] 所以我们用CMR来initialize the camera。
由于这个相机位置是不断oprimize的,image不可能完美对齐,需要一个鲁棒的texture loss,见下文
3.2 chamfer texture loss
将image看做2D点云,每个点有2D坐标和3D的RGB颜色值。 两个图像的dissimilarity就用chamfer distance来表达。 其中distance D 被分解为 appearance term and spatial term, 都用的l2 distance。 重要:具体来说,考虑到我们只想让他tolerant on local misalignment, 因此在spatial term上增加了一个exp操作来惩罚空间距离过远的点,变成这样: 解释:首先是Da和Ds相乘。 增加epsilon是如果有一样位置的点,颜色相差极大,那应该算作不同的点,免得给他弄成零了; 然后Ds这边加上指数,惩罚距离太远的,因为我只想要较小的misalignment 取个max 注意:Ds这一项是不可微的,他只是训练Da(texture)用的权重。
这个东西挺有用的,请看消融实验:
3.3 Chamfer Mask Loss
从3D shape 得到mask需要rasterization that discretizes the mesh into a grid of pixels. 这一部会导致信息丢失,引入误差,对训练好的ConvMesh影响尤其大。 为此,作者提出Chamfer Mask Loss Lcm. 不是将mesh渲染为binary mask,而是把mesh的点直接投影到image plane,得到Sv。 然后把用现成工具分割得到的前景点的坐标给normalize到-1到1之间,得到Sf。 然后计算Sv和Sf的chamfer distance
总loss
pixel-level chamfer texture loss (appearance) feature-level chamfer texture loss (appearance) chamfer mask loss (geometry) smooth loss (neighboring faces to have similar normals i.e. low cosine) latent space loss (L2 norm of z to ensure Gaussian distribution)
等下仔细看看代码,尤其是这个latent space loss。 以及那个feature level是咋搞啊。
Experiments
datasets: CUB-200-2011 (鸟类) PASCAL3D: cars pretrain ConvMesh: pseudo ground truths ??? 感觉是指上文提到的那个segmentation和camera pose prediction网络得到的结果。 inference 时GAN inversion: 似乎也是pseudo ground truths。 evaluation: 用的GT了 geometry accuracy: rendered masks 和 GT masks的2D mask IoU appearance quality: image synthesis metric FID (single view and multi view), 反映了GT images和generated images的分布的相似性。 user study: 找了40个user来打分。 (PASCAL3D 特有:有approximated 3D CAD shapes,可以用3D IoU)
Texture Flow vs. Texture Regression
Texture Flow 更常用,但在invisible的地方容易出错;因为容易copy foreground pixies including the obstacles.
实现(主要来自补充材料)
时间,显存,设备GPU
Pre-training: 600 epochs, with a batch size of 128, 15 hours on four Nvidia V100 GPUs.
网络结构:和ConvMesh一样。
convolutional generator G with 2 branches. 输入:latent code z (64) 输出:deformation map S 32*32; texture map T 512-512 UV space discriminator deformation map texture map image space discriminator (PatchGAN)