• Stars
    star
    275
  • Rank 149,796 (Top 3 %)
  • Language
    MATLAB
  • License
    MIT License
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

EDTER: Edge Detection with Transformer, in CVPR 2022

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
            ......

inital weights

If you are unable to download due to network reasons, you can download the inital weights 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

Eval

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) or Google Drive
EDTER-BSDS-VOC-StageII BaiDuNetdisk (Code:skjw) or Google Drive
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}
}