Thank you for the excellent code!
While studying the HTB-SR model, I noticed the following code in the file.
Here, the weights tensor is cloned:
|
head_torso_alpha = weights_256.clone() |
At this point, (head_torso_alpha > weights_256) should always be False.
Therefore, does the following line of code—
|
head_torso_alpha[head_torso_alpha>weights_256] = weights_256[head_torso_alpha>weights_256] |
—have no effect?
|
elif hparams['htbsr_head_weight_fuse_mode'] == 'v2': |
|
# 用alpha-cat实现head torso的x的融合;替代了之前的直接alpha相加 |
|
head_torso_alpha = weights_256.clone() |
|
head_torso_alpha[head_torso_alpha>weights_256] = weights_256[head_torso_alpha>weights_256] |
|
rgb = rgb * head_torso_alpha + rgb_torso * (1-head_torso_alpha) # get person img |
|
x = torch.cat([x * head_torso_alpha, x_torso * (1-head_torso_alpha)], dim=1) |
|
x = self.fuse_head_torso_convs(x) |
|
x, rgb = self.head_torso_block(x, rgb, ws, **block_kwargs) |
|
|
|
head_occlusion = head_torso_alpha.clone() |
Thank you for the excellent code!
While studying the HTB-SR model, I noticed the following code in the file.
Here, the weights tensor is cloned:
Real3DPortrait/modules/real3d/super_resolution/sr_with_ref.py
Line 108 in a9d70c7
At this point, (head_torso_alpha > weights_256) should always be False.
Therefore, does the following line of code—
Real3DPortrait/modules/real3d/super_resolution/sr_with_ref.py
Line 109 in a9d70c7
—have no effect?
Real3DPortrait/modules/real3d/super_resolution/sr_with_ref.py
Lines 106 to 115 in a9d70c7