Lu-Feng / SelaVPR

Official repository for the ICLR 2024 paper "Towards Seamless Adaptation of Pre-trained Models for Visual Place Recognition".
MIT License
185 stars 11 forks source link

question about visual_match #9

Open faithzxr opened 1 week ago

faithzxr commented 1 week ago

Hello, I would like to ask about the matching pairs in the two images. If we are using the "coarse" mode, what is the dimensionality of the patch_feature? Additionally, why is it patch_feature0[0] that is passed to the match_batch_tensor function instead of patch_feature0? Thank you.

您好,想问一下,如果对于两张图中的匹配对,如果是coarse这种模式,这个patch_feature是什么维度呢?为什么match_batch_tensor(patch_feature0[0], patch_feature1, img_size=(224,224))这里传进去的是,patch_feature0[0],为什么不是patch_feature0呢,谢谢。

Lu-Feng commented 1 week ago

您好,match_batch_tensor()传入的第一个参数是单个查询图像的特征(需要去掉batch维度所以直接加了[0]),第二个参数是包含batch维度的数据集图像的特征。

faithzxr commented 1 week ago

谢谢作者的及时回答,如果我想看两张图之间的匹配,我的的特征都是196*768,我传入的查询是(196,768),第二个我加了一个维度1相当于batch=1,即传进去的是(1,196,768)这样是对的嘛?

Lu-Feng commented 1 week ago

是的。

faithzxr commented 1 week ago

是的。

当inlier_keypoints_one = kps[idx1.cpu().numpy()] inlier_keypoints_two = kps[idx2.cpu().numpy()]只有一对匹配对的时候,kp_all1.append(cv2.KeyPoint(inlier_keypoints_one[k, 0].astype(float), inlier_keypoints_one[k, 1].astype(float), 1, -1, 0, 0, -1))这一部分好像会报错,因为当只有一对点的时候,他是这种[152 104]一维的,但当是多对点的时候[[8 8] [24 8]]就是这种[[8 8] [24 8]]二维的就没问题,当是一对点的时候,我处理了一下,这样是对的嘛,还是我搞错了呢?