yosungho / LineTR

Line as a Visual Sentence: Context-aware Line Descriptor for Visual Localization (Line Transformer)
Other
238 stars 35 forks source link

Could you share the train code? #6

Closed ChrisLLLLL closed 2 years ago

ChrisLLLLL commented 2 years ago

Thank you for your work! Could you share the train code?

yosungho commented 2 years ago

Hi Chris, The training code isn't ready to be shared. To create the training code, I referred to SuperPoint and SuperGlue and there are several training codes that we can utilize (e.g. LoFTR, D2-Net, etc.). Please consider making a line version of them.

ChrisLLLLL commented 2 years ago

ok,Thank you for your answer

ChrisLLLLL commented 2 years ago

Hi Chris, The training code isn't ready to be shared. To create the training code, I referred to SuperPoint and SuperGlue and there are several training codes that we can utilize (e.g. LoFTR, D2-Net, etc.). Please consider making a line version of them. I tried to change the training code with reference to superglue and superpoint, but my ability did not get the results I wanted, I had to come to you as a last resort.

yosungho commented 2 years ago

Hello, my scientific research has reached a crisis period, my thesis has not been progressing, I intend to make some changes on your basis to use. I had to come to you again for training code. my mail address is 690376582@qq.com. I really beg if you can send me a training code. I promise to use it only for myself.

Hi Chris. Okay, I will share the training code for homography augmentation within a few days. However, the ScanNet training code is not going to be opened since it is unorganized.

ChrisLLLLL commented 2 years ago

Thanks again, I read your paper again, I think by learning your code I will be able to know how to establish ground-truth line correspondences from an image pair. and use it to train. If you send it in two days, it will be very helpful to me. Thank you for taking the time to check and reply to my question. Best wishes to you!

yosungho commented 2 years ago

Chris, I will upload the base training code this weekend. I did not have enough spare time due to my full-time work. Thanks.

ChrisLLLLL commented 2 years ago

I'm sorry for the trouble my anxiety has caused you, thank you again for your efforts

yosungho commented 2 years ago

I'm sorry for the trouble my anxiety has caused you, thank you again for your efforts

Hi Chris. As I mentioned, I upload the training code. You may need storage for the dataset files. Please have a try. :)

ChrisLLLLL commented 2 years ago

Thank you very much, I tried it and use wireframe dataset, but in "build_homograpy_dataset" I often encounter "valueErroe:could not broardcast input array from shape(480,2 ) into shape (450,2)". Does it have something to do with me not naming the pictures in order?

ChrisLLLLL commented 2 years ago

I feel like I want to know what the problem is. I want to know why the processing time of the original picture is 1~2s, but the processing time of wireframe dateset(one picture) is 3.5s.

yosungho commented 2 years ago

I found that the hardcoded image_size caused such errors, and I corrected them now. The processing time would be varied on the number of lines. Please try to adjust the max number of sublines to be smaller.

ChrisLLLLL commented 2 years ago

I found that the hardcoded image_size caused such errors, and I corrected them now. The processing time would be varied on the number of lines. Please try to adjust the max number of sublines to be smaller.

I will try it, thank you!

ChrisLLLLL commented 2 years ago

Hi. This error is still not resolved. I found out that it was caused by too many matching lines(many-to-many correspondences), Should I raise the threshold“min_overlap_ratio” but will this reduce the training effect? How to let the lines one-to-one?

"Traceback (most recent call last): File "dataloaders/build_homography_dataset.py", line 303, in main() File "dataloaders/build_homography_dataset.py", line 297, in main dataset.getitem(iter, idx) File "dataloaders/build_homography_dataset.py", line 238, in getitem lmatches_ret[:len(lmatches)] = lmatches ValueError: could not broadcast input array from shape (504,2) into shape (375,2) "

yosungho commented 2 years ago

Yes, you can raise the min_overlap_ratio to have fewer but more exact GT matches. I think the error occurs because there were too many multiple matching as you mentioned. You can increase the 1.5 to a larger number to resolve it, fixing every other parameter. (the 1.5 represents a margin) For the other options, you can also increase token_distance or min_overlap_ratio to have fewer line correspondences.

ChrisLLLLL commented 2 years ago

Thank you. I'll give it a try, hopefully it won't reduce the training accuracy.