/Eigenlanes

Official code for "Eigenlanes: Data-Driven Lane Descriptors for Structurally Diverse Lanes", CVPR2022

Primary LanguagePythonApache License 2.0Apache-2.0

Python 3.6

[CVPR 2022] Eigenlanes: Data-Driven Lane Descriptors for Structurally Diverse Lanes

Dongkwon Jin, Wonhui Park, Seong-Gyun Jeong, Heeyeon Kwon, and Chang-Su Kim

overview

Official implementation for "Eigenlanes: Data-Driven Lane Descriptors for Structurally Diverse Lanes" [paper] [arxiv] [video].

A new dataset called "SDLane" is available at here.

Video

Video

Related work

We also presented another paper, "Eigencontours: Novel Contour Descriptors Based on Low-Rank Approximation", accepted to CVPR 2022 (oral) [github] [video].

Requirements

  • PyTorch >= 1.6
  • CUDA >= 10.0
  • CuDNN >= 7.6.5
  • python >= 3.6

Installation

  1. Download repository. We call this directory as ROOT:
$ git clone https://github.com/dongkwonjin/Eigenlanes.git
  1. Download pre-trained model parameters and preprocessed data in ROOT:
$ cd ROOT
$ unzip pretrained.zip
$ unzip preprocessed.zip
  1. Create conda environment:
$ conda create -n eigenlanes python=3.7 anaconda
$ conda activate eigenlanes
  1. Install dependencies:
$ conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
$ pip install -r requirements.txt

Directory structure

.                           # ROOT
├── Preprocessing           # directory for data preprocessing
│   ├── culane              # dataset name (culane, tusimple)
|   |   ├── P00             # preprocessing step 1
|   |   |   ├── code
|   |   ├── P01             # preprocessing step 2
|   |   |   ├── code
|   │   └── ...
│   └── ...                 # etc.
├── Modeling                # directory for modeling
│   ├── culane              # dataset name (culane, tusimple)
|   |   ├── code
│   ├── tusimple           
|   |   ├── code
│   └── ...                 # etc.
├── pretrained              # pretrained model parameters 
│   ├── culane              
│   ├── tusimple            
│   └── ...                 # etc.
├── preprocessed            # preprocessed data
│   ├── culane              # dataset name (culane, tusimple)
|   |   ├── P03             
|   |   |   ├── output
|   |   ├── P04             
|   |   |   ├── output
|   │   └── ...
│   └── ...
.

Evaluation (for CULane)

To test on CULane, you need to install official CULane evaluation tools. The official metric implementation is available here. Please downloads the tools into ROOT/Modeling/culane/code/evaluation/culane/. The tools require OpenCV C++. Please follow here to install OpenCV C++. Then, you compile the evaluation tools. We recommend to see an installation guideline

$ cd ROOT/Modeling/culane/code/evaluation/culane/
$ make

Train

  1. Set the dataset you want to train (DATASET_NAME)
  2. Parse your dataset path into the -dataset_dir argument.
  3. Edit config.py if you want to control the training process in detail
$ cd ROOT/Modeling/DATASET_NAME/code/
$ python main.py --run_mode train --pre_dir ROOT/preprocessed/DATASET_NAME/ --dataset_dir /where/is/your/dataset/path/ 

Test

  1. Set the dataset you want to test (DATASET_NAME)
  2. Parse your dataset path into the -dataset_dir argument.
  3. If you want to get the performances of our work,
$ cd ROOT/Modeling/DATASET_NAME/code/
$ python main.py --run_mode test_paper --pre_dir ROOT/preprocessed/DATASET_NAME/ --paper_weight_dir ROOT/pretrained/DATASET_NAME/ --dataset_dir /where/is/your/dataset/path/
  1. If you want to evaluate a model you trained,
$ cd ROOT/Modeling/DATASET_NAME/code/
$ python main.py --run_mode test --pre_dir ROOT/preprocessed/DATASET_NAME/ --dataset_dir /where/is/your/dataset/path/

Preprocessing

example

Data preprocessing is divided into five steps, which are P00, P01, P02, P03, and P04. Below we describe each step in detail.

  1. In P00, the type of ground-truth lanes in a dataset is converted to pickle format.
  2. In P01, each lane in a training set is represented by 2D points sampled uniformly in the vertical direction.
  3. In P02, lane matrix is constructed and SVD is performed. Then, each lane is transformed to its coefficient vector.
  4. In P03, clustering is performed to obtain lane candidates.
  5. In P04, training labels are generated to train the SI module in the proposed SIIC-Net.

If you want to get the preproessed data, please run the preprocessing codes in order. Also, you can download the preprocessed data.

$ cd ROOT/Preprocessing/DATASET_NAME/PXX_each_preprocessing_step/code/
$ python main.py --dataset_dir /where/is/your/dataset/path/

Reference

@Inproceedings{
    Jin2022eigenlanes,
    title={Eigenlanes: Data-Driven Lane Descriptors for Structurally Diverse Lanes},
    author={Jin, Dongkwon and Park, Wonhui and Jeong, Seong-Gyun and Kwon, Heeyeon and Kim, Chang-Su},
    booktitle={CVPR},
    year={2022}
}