Lu-Feng / DHE-VPR

Official repository for the AAAI 2024 paper "Deep Homography Estimation for Visual Place Recognition".
MIT License
65 stars 4 forks source link

About compute_similarity #4

Closed cswwp closed 4 months ago

cswwp commented 4 months ago

Hi @Lu-Feng , i have a question about compute_similarity function in network.py, why do eatures_a.transpose(2, 3), in my thinking , the shape of features_a and feature_b both are nch*w. seems your code do transpose(2, 3) with features_a, but no transform with features_b. image

Lu-Feng commented 4 months ago

Sorry for late reply. This function is based on the compute_similarity function of GeoWarp. It seems that whether or not the transpose(2, 3) is performed does not make a significant difference. Performing features_a.transpose(2, 3) will only make a difference in the order of the elements in channel dimension in the similarity map (i.e. correlation_tensor), which will not have a significant impact on the subsequent use of it in the homography regression module. The network should be able to learn this order.

cswwp commented 4 months ago

Sorry for late reply. This function is based on the compute_similarity function of GeoWarp. It seems that whether or not the transpose(2, 3) is performed does not make a significant difference. Performing features_a.transpose(2, 3) will only make a difference in the order of the elements in channel dimension in the similarity map (i.e. correlation_tensor), which will not have a significant impact on the subsequent use of it in the homography regression module. The network should be able to learn this order.

In other words, does it mean no necessary to do transpose with feature_a, it's ok just keep consistency between train and test.

Lu-Feng commented 4 months ago

Sorry for late reply. This function is based on the compute_similarity function of GeoWarp. It seems that whether or not the transpose(2, 3) is performed does not make a significant difference. Performing features_a.transpose(2, 3) will only make a difference in the order of the elements in channel dimension in the similarity map (i.e. correlation_tensor), which will not have a significant impact on the subsequent use of it in the homography regression module. The network should be able to learn this order.

In other words, does it mean no necessary to do transpose with feature_a, it's ok just keep consistency between train and test.

Yes, I think so. But I haven't verified it experimentally.