Spaces:
Runtime error
A newer version of the Gradio SDK is available:
4.44.0
Richer Convolutional Features for Edge Detection
This is the PyTorch implementation of our edge detection method, RCF.
Citations
If you are using the code/model/data provided here in a publication, please consider citing:
@article{liu2019richer,
title={Richer Convolutional Features for Edge Detection},
author={Liu, Yun and Cheng, Ming-Ming and Hu, Xiaowei and Bian, Jia-Wang and Zhang, Le and Bai, Xiang and Tang, Jinhui},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
volume={41},
number={8},
pages={1939--1946},
year={2019},
publisher={IEEE}
}
Training
Clone the RCF repository:
git clone https://github.com/yun-liu/RCF-PyTorch.git
Download the ImageNet-pretrained model (Google Drive or Baidu Yun), and put it into the
$ROOT_DIR
folder.Download the datasets as below, and extract these datasets to the
$ROOT_DIR/data/
folder.wget http://mftp.mmcheng.net/liuyun/rcf/data/bsds_pascal_train_pair.lst wget http://mftp.mmcheng.net/liuyun/rcf/data/HED-BSDS.tar.gz wget http://mftp.mmcheng.net/liuyun/rcf/data/PASCAL.tar.gz
Run the following command to start the training:
python train.py --save-dir /path/to/output/directory/
Testing
Download the pretrained model (BSDS500+PASCAL: Google Drive or Baidu Yun), and put it into the
$ROOT_DIR
folder.Run the following command to start the testing:
python test.py --checkpoint bsds500_pascal_model.pth --save-dir /path/to/output/directory/
This pretrained model should achieve an ODS F-measure of 0.812.
For more information about RCF and edge quality evaluation, please refer to this page: yun-liu/RCF
Edge PR Curves
We have released the code and data for plotting the edge PR curves of many existing edge detectors here.
RCF based on other frameworks
Caffe based RCF: yun-liu/RCF
Jittor based RCF: yun-liu/RCF-Jittor