DeepLSD icon indicating copy to clipboard operation
DeepLSD copied to clipboard

How to create my own dataloader

Open aquexel opened this issue 2 years ago • 9 comments

Hello Guys ! Thank you for your work,

I have a question, how to create my own DataLoader based only with lines in a JSON (x1,x2,y1,y2) for example. What DeepLSD need to be trainable ?

Thank you in advance

aquexel avatar Sep 08 '23 15:09 aquexel

Hi, DeepLSD is originally meant to be trained without ground truth lines, so we do not have any code to do what you want.

However, it could be feasible with a bit of work, by converting your lines into a distance and angle fields (e.g. using the distanceTransform of OpenCV, or doing it programmatically), and then supervising the network with these two fields.

rpautrat avatar Oct 20 '23 13:10 rpautrat

Hi, I was able to successfully integrate my own lines in addition to the LSD detector. Currently, I am working with a dataset derived from 3D scan surveys where I obtain ortho-rectified images. These images are composed of thousands of colored points. Are there any optimizable parameters to avoid detecting line fragments on image defects? Here an example (right side): Maison n°4

aquexel avatar Oct 24 '23 21:10 aquexel

Hi, are you using the pretrained DeepLSD, or are you retraining it on your own data? Because the pretrained model will certainly fail on this kind of data, but if you retrain it with these artifacts in the data, it might be able to ignore them. For example you could generate the line ground truth from your 3d scans (by fitting lines to aligned points), then reproject them to 2d to get a ground truth.

rpautrat avatar Oct 25 '23 09:10 rpautrat

I retraining by using my data, but I don't know if it's better to change some parameters (like more counts on homography_adaptation) or freeze the backbone and train the head

aquexel avatar Oct 25 '23 10:10 aquexel

I think you can keep the same parameters and retrain the whole backbone+head, this should be fine.

rpautrat avatar Oct 25 '23 10:10 rpautrat

Did you try other backbones ?

aquexel avatar Oct 26 '23 16:10 aquexel

We also tried a few other networks: FCN for instance segmentation, the backbone of DeepLabv3, and a simple vgg. In the end, the UNet was the best in our case.

rpautrat avatar Oct 26 '23 20:10 rpautrat

Hi ! Okay, did you try Resnet as a backbone ? why is there so difference between the backbone ? I have learned that the deeper the backbone, the better it is. Thanks

aquexel avatar Oct 26 '23 23:10 aquexel

We initially cast the task as a semantic segmentation task, which is why we tested semantic segmentation backbones.

The deeper is not always necessarily the better. In DeepLSD, the task of the network is quite low-level, so a shallower network is better and we did not try ResNet. But feel free to try it for your own task. In your case, a deeper network could potentially help to fix the artifacts that you have in your data.

rpautrat avatar Oct 27 '23 07:10 rpautrat