Apoorvg2000 / board_matcher_sweep

0 stars 0 forks source link

Sweep: Add functionality to match features of images based on their dimensions #2

Open Apoorvg2000 opened 11 months ago

Apoorvg2000 commented 11 months ago

Details

Add the functionality to match features of two images whose paths are received as the function parameters in the cuda_orb_match method in the cuda_orb_board_matching.py file based on their height and width, that is, match their features only if below conditions are satisfied:

  1. let the height of first image be h1 and height of second image be h2. Ratio of h1 and h2, that is, h1/h2 <= 1.5
  2. let the width of first image be w1 and width of second image be w2. Ratio of w1 and w2, that is, w1/w2 <= 1.5

If the above two conditions are satisfied then only match the features of images the cuda_orb_match method otherwise return (0, 0) from the cuda_orb_match method.

Also after calculating the heights and widths of the images, store the height and width of the images in pickle files named “heights.pkl” and “widths.pkl” respectively using the images’s basename. If the pickle files do not exist, first create the files and then proceed further. Before calculating the height and width of the images, check if the image basename is present in “heights.pkl” and “widths.pkl” pickle files. If the image basename is present in the pickles files, then use the stored height and width of the image otherwise calculate the height and width of the image and store them in the pickle files for future use.

Emphasise on writing efficient and clean code.

Checklist - [X] Modify `cuda_orb_board_matching.py` ✓ https://github.com/Apoorvg2000/board_matcher_sweep/commit/df6c6de164d473f0c44e03c1c421921ec615efc1 - [X] Running GitHub Actions for `cuda_orb_board_matching.py` ✓ ![Flowchart](https://raw.githubusercontent.com/Apoorvg2000/board_matcher_sweep/sweep/assets/eb9e21133ef5a3c1af84aac889c4d37483c38b397bfb76e01ba6a3dc19860a46_2_flowchart.svg)
sweep-test-apoorv[bot] commented 11 months ago

Here's the PR! https://github.com/Apoorvg2000/board_matcher_sweep/pull/5. See Sweep's process at dashboard.

💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: e2badd54a7)

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 8fe9c3b
Checking cuda_orb_board_matching.py for syntax errors... ✅ cuda_orb_board_matching.py has no syntax errors! 1/1 ✓
Checking cuda_orb_board_matching.py for syntax errors...
✅ cuda_orb_board_matching.py has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L99-L142 https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L66-L99 https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L32-L60 https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L64-L66 https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L60-L64 https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L19-L32 https://github.com/Apoorvg2000/board_matcher_sweep/blob/8fe9c3b8498b37c55fcda6b1164afacad33dce7e/cuda_orb_board_matching.py#L1-L19

Step 2: ⌨️ Coding

Ran GitHub Actions for df6c6de164d473f0c44e03c1c421921ec615efc1:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/dimension-based-matching.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord