Zhaoyi-Yan / Shift-Net_pytorch

Pytorch implementation of Shift-Net: Image Inpainting via Deep Feature Rearrangement (ECCV, 2018)
http://openaccess.thecvf.com/content_ECCV_2018/papers/Zhaoyi_Yan_Shift-Net_Image_Inpainting_ECCV_2018_paper.pdf
MIT License
362 stars 83 forks source link

Have you tried to downsample the mask directly using nearest neighbour? #93

Open raywzy opened 5 years ago

raywzy commented 5 years ago

I am curious about the method that you mentioned to obtain the mask of feature map. Why not downsample directly?

Zhaoyi-Yan commented 5 years ago

Emmm, in fact, several reasons.

  1. Shift-Net is started in early 2017. At that time, no works mention directly how to obtain the mask region in feature map. We have to use figure out the mask to perform shift, however, no prior work at all. So we have to think up a method to handle it.
  2. We define the threshold as 5/16 in our case, and find it is the optimal value. Several months later, I find 5/16 as the threshold performs exactly the same as NearestSampling... So I move the part of feature-mask defination to the supplementary in the v2 in arxiv. And totally remove it on the ECCV version.

You can find https://github.com/Zhaoyi-Yan/Shift-Net_pytorch/blob/master/util/util.py#L210 is directly adopting nearest sampling, which for torch(deprecated now), it is still the original version https://github.com/Zhaoyi-Yan/Shift-Net/blob/master/lib/myUtils.lua#L36

raywzy commented 5 years ago

@Zhaoyi-Yan Thanks for your explaination. Your work is very solid.