# pytorch-HED
**Repository Path**: gshang/pytorch-HED
## Basic Information
- **Project Name**: pytorch-HED
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-04-26
- **Last Updated**: 2021-11-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# HED in pytorch
[](https://arxiv.org/pdf/1504.06375.pdf)
[](https://opensource.org/licenses/MIT)
This work is an implementation of paper [Holistically-Nested Edge Detection](https://arxiv.org/pdf/1504.06375.pdf).
## Performance
Input Image | dsn1 | dsn2 | dsn3 | dsn4 | dsn5 | Fusioned Output (dsn6) |
:-------------------------:|:----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  | dsn refers to deep side output.
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
 |  |  |  |  |  |  |
**On BSDS500**
| Method | ODS (Fusion/Merged) | OIS (Fusion/Merged) | AP (Fusion/Merged) |
|:---|:---:|:---:|:---:|
| Our Implementation | 0.78731/0.78280 | 0.80623/0.80356 | 0.78632/0.83851 |
| Original Paper| 0.782/0.782 | 0.802/0.804 | 0.787/0.833 |
As mentioned in the paper, Fusion refers to the fusion-output(dsn6) and Merged means results of combination of fusion layer and side outputs.
## How to Run
### Prerequisite:
* Pytorch>=0.3.1
* Tensorboard
* [AttrDict](https://github.com/bcj/AttrDict)
### Training/Testing
The coda/data structure
```shell
$ROOT
- ckpt # save checking points
- data # contains BSDS500
- matlab_code # test code
- pytorch-HED # current repo
```
To prepare for data, please refer to Training HED part in https://github.com/s9xie/hed
For training
```
python submit.py
```
Create your custom configuration file (xxx.yaml) in ./config, and modify config_file in submit.py.
Our implementation is a little different form the original caffe version. We used vgg architecture with BN layers, and also more data argumentations.
For testing, please install the Piotr's matlab toolbox first. Please refer to https://github.com/s9xie/hed.
## References
```
@InProceedings{xie_HED,
author = {"Xie, Saining and Tu, Zhuowen"},
Title = {Holistically-Nested Edge Detection},
Booktitle = "Proceedings of IEEE International Conference on Computer Vision",
Year = {2015},
}
```
## Related Projects
[1]. [Original Implementation](https://github.com/s9xie/hed) by @s9xie
[2]. [hed](https://github.com/xwjabc/hed) by @xwjabc
[3]. [hed-pytorch](https://github.com/meteorshowers/hed-pytorch) by @meteorshowers
[4]. [hed(caffe)](https://github.com/zeakey/hed) by @zeakey