firstelfin / EDTER

EDTER: Edge Detection with Transformer, in CVPR 2022

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EDTER

EDTER: Edge Detection with Transformer
Mengyang Pu, Yaping Huang, Yuming Liu, Qingji Guan and Haibin Ling
CVPR 2022

Please refer to supplementary material for more results.

Usage

Datasets

BSDS500

Download the augmented BSDS500 data (1.2GB) from here.

|-- data
    |-- BSDS
        |-- ImageSets
        |   |-- train_pair.txt
        |   |-- test.txt
        |   |-- pascal_train_pair.txt
        |-- train
        |   |-- aug_data
        |   |-- aug_data_scale_0.5
        |   |-- aug_data_scale_1.5
        |   |-- aug_gt
        |   |-- aug_gt_scale_0.5
        |   |-- aug_gt_scale_1.5
        |-- test
        |   |-- 2018.jpg
        ......

NYUD

Download the augmented NYUD data (~11GB) from here(Code:t2ce).

|-- data
    |-- NYUD
        |-- ImageSets
        |   |-- hha-test.txt
        |   |-- hha-train.txt
        |   |-- image-test.txt
        |   |-- image-train.txt
        |-- train
            |-- GT
            |-- GT_05
            |-- GT_15
            |-- HHA
            |-- HHA_05
            |-- HHA_15
            |-- Images
            |-- Images_05
            |-- Images_15
        |-- test
            |-- HHA
            |   |-- img_5001.png
            ......
            |-- Images
            |   |-- img_5001.png
            ......

Pre-trained model

If you are unable to download due to network reasons, you can download the pre-trained model from here and here.

Training

The training of Stage I

./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} 
# For example, train Stage I on BSDS500 dataset with 8 GPUs
./tools/dist_train.sh configs/bsds/EDTER_BIMLA_320x320_80k_bsds_bs_8.py 8

The training of Stage II

Change the '--global-model-path' in train_local.py.

./tools/dist_train_local.sh ${GLOBALCONFIG_FILE} ${CONFIG_FILE} ${GPU_NUM} 
# For example, train Stage II on BSDS500 dataset with 8 GPUs
./tools/dist_train_local.sh configs/bsds/EDTER_BIMLA_320x320_80k_bsds_bs_8.py configs/bsds/EDTER_BIMLA_320x320_80k_bsds_local8x8_bs_8.py 8

Testing

Single-scale testing

Change the '--config', '--checkpoint', and '--tmpdir' in test.py.

python tools/test.py

Multi-scale testing

Change the '--globalconfig', '--config', '--global-checkpoint', '--checkpoint', and '--tmpdir' in test_local.py.
Use the config file ending in _ms.py in configs/EDTER.

python tools/test_local.py

BSDS500

cd eval
run eval_bsds.m

NYUD

Download the matfile(NYUD) from here(Code:25p8).

cd eval
run eval_nyud.m

Results

If you want to compare your method with EDTER, you can download the precomputed results BSDS500 and NYUD(code:b941).

Download Pre-trained model.

model Pre-trained Model
EDTER-BSDS-VOC-StageI BaiDuNetdisk (Code:l282)
EDTER-BSDS-VOC-StageII BaiDuNetdisk (Code:skjw)
EDTER-NYUD-RGB-StageI BaiDuNetdisk (Code:dwdi)
EDTER-NYUD-RGB-StageII BaiDuNetdisk (Code:s00u)
EDTER-NYUD-HHA-StageI BaiDuNetdisk (Code:ko2f)
EDTER-NYUD-HHA-StageII BaiDuNetdisk (Code:p7wu)

Acknowledgments

  • We thank the anonymous reviewers for valuable and inspiring comments and suggestions.
  • Thanks to previous open-sourced repo:
    SETR
    MMsegmentation

Reference

@InProceedings{Pu_2022_CVPR,
    author    = {Pu, Mengyang and Huang, Yaping and Liu, Yuming and Guan, Qingji and Ling, Haibin},
    title     = {EDTER: Edge Detection With Transformer},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2022},
    pages     = {1402-1412}
}

About

EDTER: Edge Detection with Transformer, in CVPR 2022

License:MIT License


Languages

Language:MATLAB 33.3%Language:Python 31.5%Language:HTML 26.9%Language:C++ 6.8%Language:C 1.3%Language:Shell 0.1%Language:CSS 0.0%Language:Dockerfile 0.0%