Skip to content

Commit

Permalink
Fixed keypoint pixel positions
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHausler committed Nov 2, 2021
1 parent 8d5b90a commit 6005b55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patchnetvlad/models/local_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def calc_receptive_boxes(height, width):
Returns:
rf_boxes: [N, 4] receptive boxes tensor. Here N equals to height x width.
Each box is represented by [ymin, xmin, ymax, xmax].
Each box is represented by [xmin, ymin, xmax, ymax].
"""

rf, stride, padding = [196.0, 16.0, 90.0] # hardcoded for vgg-16 conv5_3
Expand Down Expand Up @@ -108,7 +108,7 @@ def calc_keypoint_centers_from_patches(config, patch_size_h, patch_size_w, strid
for i in range(0, Hout, stride_h):
for j in range(0, Wout, stride_w):
keypoints[0, k] = ((boxes[j + (i * W), 0] + boxes[(j + (patch_size[1] - 1)) + (i * W), 2]) / 2)
keypoints[1, k] = ((boxes[j + ((i + 1) * W), 1] + boxes[j + ((i + (patch_size[0] - 1)) * W), 3]) / 2)
keypoints[1, k] = ((boxes[j + (i * W), 1] + boxes[j + ((i + (patch_size[0] - 1)) * W), 3]) / 2)
indices[0, k] = j
indices[1, k] = i
k += 1
Expand Down

0 comments on commit 6005b55

Please sign in to comment.