Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuperGlue can't be used #1

Open
Jay230223 opened this issue Feb 17, 2023 · 8 comments
Open

SuperGlue can't be used #1

Jay230223 opened this issue Feb 17, 2023 · 8 comments

Comments

@Jay230223
Copy link

hello oym1994
There's some question about the SuperGlue!
First, the ".engine" of SuperGlue can't be generated;
Second, the matcher of SuplerGlue isn‘’t defined;
so, is there any code to be added, thank you!

@song-GAO-1992
Copy link

same problem

@oym1994
Copy link
Owner

oym1994 commented Mar 22, 2023

hello oym1994 There's some question about the SuperGlue! First, the ".engine" of SuperGlue can't be generated; Second, the matcher of SuplerGlue isn‘’t defined; so, is there any code to be added, thank you!

Hi, the engine will be automaticly generated if there exists no such file. But you need TensorRT with version 8.2.3 or above, or the generation process may fail.

So what is your GPU platform and tensortRT version? Can you show more error message?

@oym1994
Copy link
Owner

oym1994 commented Mar 22, 2023

same problem

Hi, what is your GPU platform and tensortRT version? Can you show more error message?

@oym1994
Copy link
Owner

oym1994 commented Mar 22, 2023

hello oym1994 There's some question about the SuperGlue! First, the ".engine" of SuperGlue can't be generated; Second, the matcher of SuplerGlue isn‘’t defined; so, is there any code to be added, thank you!

Hi, the engine will be automaticly generated if there exists no such file. But you need TensorRT with version 8.2.3 or above, or the generation process may fail.

So what is your GPU platform and tensortRT version? Can you show more error message?

As for the match function, sorry I forget the upload the newest commit, now I am not convenient for this. you can try adding code with the same logic in the function below:

void matchFeatures(const cv::Mat &desc_source, const cv::Mat &desc_ref,
std::vectorcv::DMatch &matches,
std::string selectorType)
{

// perform matching task
if (selectorType.compare("SEL_NN") == 0)
{ // nearest neighbor (best match)
  keypoints_matcher_->match(
      desc_source, desc_ref,
      matches); // Finds the best match for each descriptor in desc_source
}
else if (selectorType.compare("SEL_KNN") ==
         0)
{ // k nearest neighbors (k=2)

  std::vector<std::vector<cv::DMatch>> knn_matches;
  keypoints_matcher_->knnMatch(desc_source, desc_ref, knn_matches, 2);
  double minDescDistRatio = 0.8;
  for (auto it = knn_matches.begin(); it != knn_matches.end(); ++it)
  {
    if ((*it)[0].distance < minDescDistRatio * (*it)[1].distance)
    {
      matches.push_back((*it)[0]);
    }
  }
}

}

If succeeded, please pull a request. Warmly welcome!

@PigBroA
Copy link

PigBroA commented Apr 10, 2023

Hi @oym1994

Thanks for sharing.

I'm trying to run your code, but I got some problem to do.

In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?

Here is the part about error.
Screenshot from 2023-04-10 15-23-48

When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).

Thanks.

@oym1994
Copy link
Owner

oym1994 commented Oct 25, 2023

Hi @oym1994

Thanks for sharing.

I'm trying to run your code, but I got some problem to do.

In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?

Here is the part about error. Screenshot from 2023-04-10 15-23-48

When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).

Thanks.

Hi, what kind of keypoints and descriptors are used? Currently, superglue has only been tested with superpoint. And you may need to get fixed number of keypoints (depend on the infer number during onnx creation procedure).

1 similar comment
@oym1994
Copy link
Owner

oym1994 commented Oct 25, 2023

Hi @oym1994

Thanks for sharing.

I'm trying to run your code, but I got some problem to do.

In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?

Here is the part about error. Screenshot from 2023-04-10 15-23-48

When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).

Thanks.

Hi, what kind of keypoints and descriptors are used? Currently, superglue has only been tested with superpoint. And you may need to get fixed number of keypoints (depend on the infer number during onnx creation procedure).

@DayBeha
Copy link

DayBeha commented Dec 27, 2023

Hi @oym1994
Thanks for sharing.
I'm trying to run your code, but I got some problem to do.
In my case, I got superglue.engine, but It cause some error, I couldn't parse the reason, could you please help me to solve it?
Here is the part about error. Screenshot from 2023-04-10 15-23-48
When the code reach matcher's match function, it shows segmentation fault(KNN as well, but other kinds of matchers(e.g., FLANN) don't show segmentation fault).
Thanks.

Hi, what kind of keypoints and descriptors are used? Currently, superglue has only been tested with superpoint. And you may need to get fixed number of keypoints (depend on the infer number during onnx creation procedure).

Hi, I got same issue when running with superpoint and superglue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants