minar09 / cp-vton-plus

Official implementation for "CP-VTON+: Clothing Shape and Texture Preserving Image-Based Virtual Try-On", CVPRW 2020
https://minar09.github.io/cpvtonplus/
MIT License
346 stars 120 forks source link

Is the gmm reg loss same as total variation loss? #31

Closed Jarvisss closed 3 years ago

Jarvisss commented 3 years ago

I have read the code carefully, the gic loss calculates the difference of flow value at each grid coordinate, on x and y directions relatively.

And the tv loss seems do the same thing. https://discuss.pytorch.org/t/implement-total-variation-loss-in-pytorch/55574

Could you please explain the difference between your gic loss and tv loss?

thaithanhtuan commented 3 years ago

TV loss and the loss we used are totally different. Based on the given link, the TV loss is calculated on the pixel value while the loss we used is based on the pixel location.

So, the TV loss is trying to make the smoothness of the warped cloth which is only suitable for non-texture (no logo, no text,...) on the clothes.

Our loss is to preserve the affine transform locally. If you increase the hyperparameter of this loss in the total loss, the deformation will be affine transformation locally and globally. But if the hyperparameter is in a reasonable value, the warped-cloth can be deformed with any shape globally and for local, it is affine transformation.

Jarvisss commented 3 years ago

Hi, thaithanhtuan, thanks for the quick reply !

The original tv loss is defined on pixel value, as the link does, it tries to regularize the local pixel smoothness.

If we modify the tv loss by changing the pixel value to location, then the things are the same with the Gicloss, right? Just like in Clothflow, page 5 , the flow regularization loss.

image