Skip to content

Commit

Permalink
Fix match_two
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias-Fischer committed Jun 22, 2021
1 parent b82dfe8 commit aaf3abe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This will create three output files in the folder specified by `result_save_fold
python match_two.py \
--config_path patchnetvlad/configs/performance.ini \
--first_im_path=patchnetvlad/example_images/tokyo_query.jpg \
--second_im_path=patchnetvlad/example_images/tokyo_db_patch_success.png
--second_im_path=patchnetvlad/example_images/tokyo_db.png
```

We provide the `match_two.py` script which computes the Patch-NetVLAD features for two given images and then determines the local feature matching between these images. While we provide example images, any image pair can be used.
Expand Down
7 changes: 4 additions & 3 deletions match_two.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ def match_two(model, device, config, im_one, im_two, plot_save_path):
im_one_pil = Image.fromarray(cv2.cvtColor(im_one, cv2.COLOR_BGR2RGB))
im_two_pil = Image.fromarray(cv2.cvtColor(im_two, cv2.COLOR_BGR2RGB))

# im_one = Image.open(opt.first_im_path)
# im_two = Image.open(opt.second_im_path)

im_one_pil = it(im_one_pil).unsqueeze(0)
im_two_pil = it(im_two_pil).unsqueeze(0)

Expand Down Expand Up @@ -217,7 +214,11 @@ def main():
raise FileNotFoundError("=> no checkpoint found at '{}'".format(resume_ckpt))

im_one = cv2.imread(opt.first_im_path, -1)
if im_one is None:
raise FileNotFoundError(opt.first_im_path + " does not exist")
im_two = cv2.imread(opt.second_im_path, -1)
if im_two is None:
raise FileNotFoundError(opt.second_im_path + " does not exist")

match_two(model, device, config, im_one, im_two, opt.plot_save_path)

Expand Down

0 comments on commit aaf3abe

Please sign in to comment.