-
Notifications
You must be signed in to change notification settings - Fork 131
Is there a bug in the calculation method of head_torso_alpha in the HTB-SR v2 model? #87
Copy link
Copy link
Open
Description
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?
Real3DPortrait/modules/real3d/super_resolution/sr_with_ref.py
Lines 106 to 115 in a9d70c7
| 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() |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels