From 02bf2d0dec39d13301b37025a2918206af19b42e Mon Sep 17 00:00:00 2001 From: Travis Driver Date: Tue, 5 Nov 2024 14:43:43 -0800 Subject: [PATCH] Fix ColmapSift unit test and update documentation --- .../detector_descriptor/test_colmap_sift.py | 6 +++- .../test_colmap_sift_detector_descriptor.py | 31 ------------------- 2 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 tests/frontend/detector_descriptor/test_colmap_sift_detector_descriptor.py diff --git a/tests/frontend/detector_descriptor/test_colmap_sift.py b/tests/frontend/detector_descriptor/test_colmap_sift.py index 55dbb4296..8e66fea46 100644 --- a/tests/frontend/detector_descriptor/test_colmap_sift.py +++ b/tests/frontend/detector_descriptor/test_colmap_sift.py @@ -18,7 +18,11 @@ class TestColmapSIFTDetectorDescriptor(test_detector_descriptor_base.TestDetecto def setUp(self): """Setup the attributes for the tests.""" super().setUp() - self.detector_descriptor = ColmapSIFTDetectorDescriptor() + # Note: pycolmap does not guarantee that the number of keypoints will not exceed the specified maximum, as there + # can be ties in terms of the response scores. E.g., if the 5000th keypoint and the 5001st keypoint have the + # same response, pycolmap will return 5001 keypoints. Setting the number of maximum keypoints lower reduces the + # risk of this happening. + self.detector_descriptor = ColmapSIFTDetectorDescriptor(max_keypoints=2000) # explicitly set the detector self.detector = DetectorFromDetectorDescriptor(self.detector_descriptor) diff --git a/tests/frontend/detector_descriptor/test_colmap_sift_detector_descriptor.py b/tests/frontend/detector_descriptor/test_colmap_sift_detector_descriptor.py deleted file mode 100644 index 09d4650a3..000000000 --- a/tests/frontend/detector_descriptor/test_colmap_sift_detector_descriptor.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Tests for SIFT detector descriptor - -Authors: Ayush Baid -""" -# import unittest - -# import tests.frontend.detector_descriptor.test_detector_descriptor_base as test_detector_descriptor_base -# from gtsfm.frontend.detector.detector_from_joint_detector_descriptor import ( -# DetectorFromDetectorDescriptor, -# ) - -# from gtsfm.frontend.detector_descriptor.colmap_sift import ColmapSIFTDetectorDescriptor - - -# class TestColmapSIFTDetectorDescriptor(test_detector_descriptor_base.TestDetectorDescriptorBase): -# """Unit tests for ColmapSIFT. - -# All unit test functions defined in TestDetectorDescriptorBase are run automatically. -# """ - -# def setUp(self): -# """Setup the attributes for the tests.""" -# super().setUp() -# self.detector_descriptor = ColmapSIFTDetectorDescriptor() - -# # explicitly set the detector -# self.detector = DetectorFromDetectorDescriptor(self.detector_descriptor) - - -# if __name__ == "__main__": -# unittest.main()