RenYurui / Global-Flow-Local-Attention

The source code for paper "Deep Image Spatial Transformation for Person Image Generation"
https://renyurui.github.io/GFLA-web
Other
561 stars 84 forks source link

Supervision for masks #6

Closed cwzat closed 4 years ago

cwzat commented 4 years ago

Hi, in this code, the masks (output of flow net) is not under supervision. But the mask is used in PoseTargetNet to generate the final output. What is the loss function of mask in flow net? Or there is no loss function about masks in flow net? Thanks!

RenYurui commented 4 years ago

There is no loss function for occlusion masks. The whole network is trained in an end-to-end manner after we pre-train the Flow Field Estimator. Therefore, we did not design loss functions for the mask.

xiaobaozi1996 commented 4 years ago

How to only train the Flow Field Estimator ? I do not understand the supervisions~Thanks

RenYurui commented 4 years ago

You can use the following code to train the Flow Field Estimator

python train.py \
--name=fashion \
--model=pose_flow \
--attn_layer=2,3 \
--kernel_size=2=5,3=3 \
--gpu_id=0 \
--dataset_mode=fashion \
--dataroot=./dataset/fashion 

We use two loss functions for the Flow Field Estimator: The Sampling Correctness Loss and The Regularization Loss. The Sampling Correctness loss is used to constrain the flow filed to sample semantically similar regions. It calculates the similarity between the warped source image and the ground truth image at the VGG feature level. The Regularization Loss is used to model the flow filed correlations of the image neighborhoods. We find that local deformations between sources and targets can be seen as the affine transformations. Therefore, we further add a regularization term to punish local regions where the transformation is not an affine transformation. Please refer to our paper for more details

xiaobaozi1996 commented 4 years ago

Thanks, by the way,when will you release the pretrained model for shapenet?

RenYurui commented 4 years ago

Thanks for your interest. We are rewriting and checking the code of the ShapeNet model. I believe it will be finished before this weekend. The source code and trained model will be released once it is done.

xiaobaozi1996 commented 4 years ago

Thanks again for your patient explaination~