MCPcopy
hub / github.com/cvg/Hierarchical-Localization / add_keypoints

Method add_keypoints

hloc/utils/database.py:184–191  ·  view source on GitHub ↗
(self, image_id, keypoints)

Source from the content-addressed store, hash-verified

182 return cursor.lastrowid
183
184 def add_keypoints(self, image_id, keypoints):
185 assert(len(keypoints.shape) == 2)
186 assert(keypoints.shape[1] in [2, 4, 6])
187
188 keypoints = np.asarray(keypoints, np.float32)
189 self.execute(
190 "INSERT INTO keypoints VALUES (?, ?, ?, ?)",
191 (image_id,) + keypoints.shape + (array_to_blob(keypoints),))
192
193 def add_descriptors(self, image_id, descriptors):
194 descriptors = np.ascontiguousarray(descriptors, np.uint8)

Callers 2

import_featuresFunction · 0.80
example_usageFunction · 0.80

Calls 1

array_to_blobFunction · 0.85

Tested by

no test coverage detected