-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there an issue with coordinate mapping in fine_matching? #46
Comments
Perhaps changing the calculation method of mkpts0_c from align_corner = True to align_corner = False in coarse_matching seems to solve the above problem. # orig: align_corner = True; v = i*scale
mkpts0_c = torch.stack(
[i_ids % data['hw0_c'][1], i_ids // data['hw0_c'][1]],
dim=1) * scale0
# suggestion: align_corner = False; v = (i + 0.5)*scale - 0.5
mkpts0_c = (torch.stack(
[i_ids % data['hw0_c'][1], i_ids // data['hw0_c'][1]],
dim=1) + 0.5) * scale0 - 0.5 For example, as for i_ids = 0, the corresponding pixel will be [(0 + 0.5) * 8 - 0.5, (0 + 0.5) * 8 - 0.5] = [3.5, 3.5]. At this time, mkpts0_c is located at the center of croped patches. |
{'auc@10': 0.7030638823809927,
|
It may be because training uses biased settings. If you use the officially provided checkpoint, directly modifying coarse matching will definitely reduce the results. If you want to modify coarse matching for training, the corresponding supervision theoretically needs to be further modified. |
so,I should change the spvs_coarse() in the supervision.py in the same time?
and
I wonder to know that the monitoring method before the transformation seems to get the coordinates of the point in the top left corner and then adjust it, but the adjustment position according to get_fine_ds_match() of fine_matching.py is based on the shift of the center point, which is not corresponding. But still got a good result. |
In the ’get_fine_ds_match function‘ of fine_matching.py, there is a - W // 2 operation when calculating mkpts0_c, which seems to assume that the initial mkpts0_c is at the center of the current cropped patch. However, when I tested the following code in fine_preprocess.py, it appears that the crop uses the result of mkpts0_c as the top-left element of the crop:
Furthermore, in fine_matching, when updating mkpts0_c, it seems that the mapping formula with align_corner=False is not used correctly; it only applies a +0.5 operation without executing -0.5 after scaling:
The text was updated successfully, but these errors were encountered: