xwjabc / hed

A PyTorch reimplementation of Holistically-Nested Edge Detection
170 stars 42 forks source link

About the aligned crop #33

Open cainiaoqiuzhu opened 3 years ago

cainiaoqiuzhu commented 3 years ago

Thank you for your contribution about the HED in pytorch. About the aligned crop, I'd like to ask you some questions, why did not you use the offset which got by (offset = (Original_length - desired length ) / 2) to crop the image?

xwjabc commented 3 years ago

Hi @cainiaoqiuzhu, it is okay to simply calculate the offset in your shown way. However, since the aim of this repo is to reproduce the Caffe version of HED as much as possible and re-use the pretrained checkpoints, I follow the same cropping (aligned crop) used in Caffe.

cainiaoqiuzhu commented 3 years ago

Hi @cainiaoqiuzhu, it is okay to simply calculate the offset in your shown way. However, since the aim of this repo is to reproduce the Caffe version of HED as much as possible and re-use the pretrained checkpoints, I follow the same cropping (aligned crop) used in Caffe.

Thank you for your reply. Actually, I used the offset got by (offset = (Original_length - desired length ) / 2) to train the HED net, I found that the F1-score is much lower than yours, I want to use your crop way to other edge_detection algorithm, such as RCF, DexiNed. Could you explain the principle of your cropping way(aligned crop), or could you tell me how to learn this way. Thank you so much again~

xwjabc commented 3 years ago

Hi, actually the aligned cropping is to mimic the corresponding crop function in Caffe. I would suggest you read the discussion first and attempt to understand the reference code in original HED.