shunsukesaito / PIFu

This repository contains the code for the paper "PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization"
https://shunsukesaito.github.io/PIFu/
Other
1.76k stars 341 forks source link

z-coordinate normalization #60

Closed sxyu closed 4 years ago

sxyu commented 4 years ago

Hi,

As I understand it, the x,y positions of PIFu's output are image-aligned; then, I was wondering what the z-position corresponds to. Is it meant to be zero at the center the body, or does it just follow some arbitrary translation from the dataset?

Thanks, Alex

shunsukesaito commented 4 years ago

Good question. I found that zero at the center of body results in faster convergence and better reconstruction accuracy. Generally taking random z-translation without normalization deteriorates reconstruction as the network cannot leverage spatial consistency across data samples.

sxyu commented 4 years ago

Ah so it is the center of body. Thanks!

z-z-zhao commented 1 year ago

class DepthNormalizer(nn.Module): def init(self, opt): super(DepthNormalizer, self).init() self.opt = opt

def forward(self, z, calibs=None, index_feat=None):
    '''
    Normalize z_feature
    :param z_feat: [B, 1, N] depth value for z in the image coordinate system
    :return:
    '''
    # Personal understanding: first change z * loadsize to the state before the operation of uv_intrinsic (uv_intrinsic is normalized xy, that is, the model is scaled after scale/ortho_ratio)
    z_feat = z * (self.opt.loadSize // 2) / self.opt.z_size
    return z_feat

What does this code mean? Why does normalization need to be normalized and why normalization needs to be divided by self.opt.z_size