Official code for "Semantic Line Combination Detector" in CVPR 2024. [arxiv].
Download the following datasets to root/Datasets/
.
SEL
and SEL_Hard
datasets are provided in here. NKL
dataset is provided in here. A new dataset called CDL
is available at here.
- Create conda environment:
$ conda create -n SLCD python=3.6 anaconda
$ conda activate SLCD
$ conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
$ pip install opencv-python==4.7.0.72
- If you want to get the performance of the paper, download our pre-trained model to
root/Modeling/pretrained/
and preprocessed data for SEL, SEL_Hard, NKL(SL5K), and CDL datasets toroot/Preprocessing/
.
. # ROOT
├── Modeling # directory for modeling
│ ├── Detector
| | ├── code
│ ├── SLCD
| | ├── code
│ ├── pretrained # pretrained model parameters
| | ├── Detector
| | | ├── checkpoint_paper_SEL.pth
| | | ├── checkpoint_paper_NKL.pth
| | | ├── checkpoint_paper_CDL.pth
| | ├── SLCD
| | | ├── checkpoint_paper_SEL.pth
| | | ├── checkpoint_paper_NKL.pth
| | | ├── checkpoint_paper_CDL.pth
├── Preprocessing # directory for preprocessed data
│ ├── SEL
| | ├── pickle
│ ├── SEL_Hard
| | ├── pickle
│ ├── NKL
| | ├── pickle
│ ├── CDL
| | ├── pickle
├── Datasets # Dataset directory
│ ├── SEL # SEL dataset
| | ├── ICCV2017_JTLEE_gt_pri_lines_for_test
| | ├── ICCV2017_JTLEE_gtlines_all
| | ├── ICCV2017_JTLEE_images
| | ├── Readme.txt
| | ├── test_idx_1716.txt
| | ├── train_idx_1716.txt
│ ├── SEL_Hard # SEL_Hard dataset
| | ├── data
| | ├── edge
| | ├── gtimgs
| | ├── images
| | ├── README
│ ├── NKL # NKL dataset
| | ├── Data
| | ├── train.txt
| | ├── val.txt
│ ├── CDL # CDL dataset
| | ├── train
| | | ├── Images
| | | ├── Labels
| | ├── test
| | | ├── Images
| | | ├── Labels
Run with
cd root/Modeling/SLCD/code/
python main.py
For training line detector
- Edit
root/Modeling/Detector/code/config.py
. Please modifyrun_mode
to'train'
. Also, set the dataset you want to train (dataset_name
). - Run with
$ cd root/Modeling/Detector/code/
$ python main.py
For training SLCD
- Edit
root/Modeling/SLCD/code/config.py
. Please modifyrun_mode
to'train'
. Also, set the dataset you want to train (dataset_name
). - Run with
$ cd root/Modeling/SLCD/code/
$ python main.py
- If you want to evaluate a model you trained, edit
root/Modeling/SLCD/code/config.py
. Please modifyrun_mode
to'test'
. Also, set the dataset you want to test (dataset_name
). - Run with
$ cd root/Modeling/SLCD/code/
$ python main.py
- Semantic line detection
- Road lane detection
- Composition-based image retrieval
- Symmetric axis detection
- Vanishing point detection