PruneTruong / DenseMatching

Dense matching library based on PyTorch
GNU Lesser General Public License v2.1
690 stars 82 forks source link

Loss calculation #10

Closed syqzdy closed 3 years ago

syqzdy commented 3 years ago

Hi, Thanks for this wonderful project. I would like to know whether the mask is involved in the loss calculation during training.

PruneTruong commented 3 years ago

Hi, thanks! Which mask are you referring to?

syqzdy commented 3 years ago

I am confused about that whether the predicted confidence map can reflect the reliability of the predicted flow and also identify the out-of-view pixels. If all works, I want to know if the out-of-view pixels are involved in the training and the loss is calculated on the out-of-view regions?

PruneTruong commented 3 years ago

Hi, i think i answered you via email, but just to be sure: The predicted confidence map doesn't explicitly differentiate unreliable matching regions from specifically out-of-view pixels. It is just usually uncertain in out-of-view pixel since the flow there is more likely to be wrong. But it can happen that if the network is still very confident about its matches in bordering out of view regions, the predicted confidence map will be confident there.

The loss is calculated everywhere, including the out-of-view regions for the synthetic data. For Megadepth, it is only computed at the location of the sparse ground-truth.