lucastabelini / LaneATT

Code for the paper entitled "Keep your Eyes on the Lane: Real-time Attention-guided Lane Detection" (CVPR 2021)
https://openaccess.thecvf.com/content/CVPR2021/html/Tabelini_Keep_Your_Eyes_on_the_Lane_Real-Time_Attention-Guided_Lane_Detection_CVPR_2021_paper.html
MIT License
634 stars 167 forks source link

How to train own data? #46

Closed JobinWeng closed 3 years ago

lucastabelini commented 3 years ago

You can either transform your annotations to a format that is already used in the project (i.e., CULane, TuSimple or LLAMAS' format) or create a class to load your annotations in a custom format. For the latter, you'll have to:

  1. Implement this "abstract class". Then, save it to the same directory (e.g., lib/datasets/custom_loader.py).
  2. Modify this file to include your loader. That is, import your loader like the others already implemented (e.g., import custom_loader as CustomLoader) and then add an if statement to use your loader (as done for the other loaders).
  3. The dataset variable read in the file in step 2 comes from the config file you'll use for training/testing. Therefore, create a config file that uses your loader by setting the attributes dataset.train.dataset and datasets.test.dataset to the string you put in that if statement (you can use the ones I provide as a basis).

This might be a bit confusing so please let me know if you have any issues.