mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Handle edge case when SuperPoint detects only 1 keypoint (#1509)
* Handle edge case when SuperPoint detects only 1 keypoint * missing normalize --------- Co-authored-by: matlabbe <matlabbe@gmail.com>
This commit is contained in:
@@ -242,8 +242,7 @@ cv::Mat SPDetector::compute(const std::vector<cv::KeyPoint> &keypoints)
|
||||
auto desc = torch::grid_sampler(desc_, grid, 0, 0, true); // [1, 256, 1, n_keypoints]
|
||||
|
||||
// normalize to 1
|
||||
desc = torch::nn::functional::normalize(desc.reshape({1, desc_.size(1), -1})); //[1, 256, n_keypoints]
|
||||
desc = desc.squeeze(); //[256, n_keypoints]
|
||||
desc = torch::nn::functional::normalize(desc.reshape({desc_.size(1), -1}), torch::nn::functional::NormalizeFuncOptions().dim(0)); //[256, n_keypoints]
|
||||
desc = desc.transpose(0, 1).contiguous(); //[n_keypoints, 256]
|
||||
|
||||
if(cuda_)
|
||||
|
||||
Reference in New Issue
Block a user