rpautrat / SuperPoint

Efficient neural feature detector and descriptor
MIT License
1.88k stars 416 forks source link

How to train with my own data? #276

Open RoyalLii opened 1 year ago

RoyalLii commented 1 year ago

I want to use the Superpoint pre-trained model to train on my own data, do I have to perform steps 1 to 6 in the training step?

rpautrat commented 1 year ago

Hi, no I think you can just use the pre-trained model to export a pseudo ground truth on your data (Step 2), and then directly jump to the training of SuperPoint with this pseudo ground truth (Step 6). If the generated pseudo ground truth does not look good enough, you might have to do one iteration of Step 2 - Step 3 - Step 2 to increase its quality.

RoyalLii commented 1 year ago

Thank you very much for your reply. I will try it.

RoyalLii commented 1 year ago

Can I use the pre-trained model is MagicPoint(synthetic) or MagicPoint(coco) in step2 ?

rpautrat commented 1 year ago

You can use both, but I would recommend the MagicPoint one. Since it is purely specialized in detection, its performance on keypoint detection is slightly better than the joint model SuperPoint.

RoyalLii commented 1 year ago

I use my own dataset for training, put my data directly into the coco2014 train directory? Running step 2,,Why do I use 235 images to generate only 85 .npz

rpautrat commented 1 year ago

Adapting it to your own images will require a bit more work I think. Please check past issues, because this question has been asked many times.

RoyalLii commented 1 year ago

Thank you for your reply Oh, I'm sorry I didn't find a relevant question,I wanted to ask how long it takes to iterate one epoch, I'm stuck in the second round of training, using a graphics card is 1080ti

rpautrat commented 1 year ago

The epoch duration depends on the size of your dataset, so I don't know how big yours is :)

foxkw commented 1 year ago

Hi, no I think you can just use the pre-trained model to export a pseudo ground truth on your data (Step 2), and then directly jump to the training of SuperPoint with this pseudo ground truth (Step 6). If the generated pseudo ground truth does not look good enough, you might have to do one iteration of Step 2 - Step 3 - Step 2 to increase its quality.

When I do this, I find that the number of labels generated will be reduced compared with that before, for example, on the vehicle/sign board

rpautrat commented 1 year ago

Having a higher number of labels does not necessarily mean that it is of higher quality. But if you prefer having more keypoints, you can always decrease the detection threshold to keep more points.

foxkw commented 1 year ago

Having a higher number of labels does not necessarily mean that it is of higher quality. But if you prefer having more keypoints, you can always decrease the detection threshold to keep more points.

Thanks for your reply. I have a question: Different resolution images have different sizes, some are large, some are small, how to set the topk and threshold parameters to obtain stable feature points, what do you think about this

rpautrat commented 1 year ago

One simple solution would be to keep always the same threshold, and not to enforce any topk. You will get more points on larger images, but since the threshold is the same, you should get similar points. Of course, SuperPoint is not very scale-invariant, so if you have big scale changes, there is no way you can get very stable keypoints in any case.

foxkw commented 1 year ago

One simple solution would be to keep always the same threshold, and not to enforce any topk. You will get more points on larger images, but since the threshold is the same, you should get similar points. Of course, SuperPoint is not very scale-invariant, so if you have big scale changes, there is no way you can get very stable keypoints in any case.

I found that the magipoint model will miss some points when export the label on images, so that the corner detection of the lane is unstable in the continuous frame image. This seems to indicate that magipoint also has shortcomings in the export label stage. Do you have any good ideas, improve it, and look forward to your reply

image image

rpautrat commented 1 year ago

Of course, MagicPoint is not perfect and will always make mistakes. The homography adaptation process is one way to improve the export, but it has its limits. Improving the keypoint ground truth is actually an ongoing area of research, so I cannot help much on this for now :)