-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
porting to the newest caffe #20
Comments
May the different implementation in crop layer cause this issue. |
I have the same problem. |
Actually I don't know why a customized Caffe is used? Even for training, any special layers are designed and used? No clue is found by looking at the prototxt only. Anyone has any idea? |
Hi all, First I want to really apologize for the slow response in the repo issues. @saedrna @zeakey @fxw6000 First that's right you need to have the padding in the first layer to avoid the shifting problem. And it is the correct behavior that you are detecting the image borders as boundaries. During testing stage, I "augment" the testing image by padding it with mirror reflections (both vertical and horizontal) of itself. Then after you get the edge map, you can just crop the center image. I'll put a note in Readme. I'm currently a little bit swamped with some other projects but I'll keep this open and let you know when I migrate this to the new caffe. |
@s9xie Thanks, I think for the time being, I can also use hed by the same trick. That is set pad the image manually with mirror reflection (using opencv) and then set pad=1 for the first layer rather than 35. Looking forward to your porting to the caffe master repo! |
@saedrna, can you make your port available? |
@stevendbrown , the porting is simple, because recent caffe support the all the layers in testing HED, except for a simple bug (the effects and solution are described above). So I will only enlarge the image outside caffe using copyMakeBorder and after hed, subseting the corresponding region. And caffe is also ported to windows by in a separate branch. |
@saedrna if you can help me get on the right track i'd be grateful. i started by attempting to apply the changes in maybe i'm misunderstanding you - do you mean that the current |
@stevendbrown , that's right, I just used the model, prototext and changed the pad to 1, the results are reasonable, except for the boarder problem. On windows, the windows branch of caffe is used. |
@saedrna i'm replicating your result with the padding. thanks for the pointer! |
it looks like the way layers are defined has changed with the current master branch of i've moved ImageLabelmapData into the current |
my hack port of the ImageLabelmapData to the current version of https://github.com/stevendbrown/caffe/tree/HED i set the padding in i'm not a computer scientist, so if anyone can comment on the chop-shop job i've done here, i'd be grateful. |
Hi @s9xie @saedrna @fxw6000 @BingTSC @juntingzh @stevendbrown Actually the shift at predicted edge map are due to the different implementation of CropLayer between HED and official branch of caffe. In HED version of caffe which I think is based on Longjon's FCN, the crop offset is computed automatically inside the network, that is, in crop layer you will not need to specify the offset. But this implementation is very complicated and has a lot of modifications on almost all layers cpp code. In the newly official branch of caffe, the crop layer has a parameter named "offset", this allow you to specify the crop offset manually, sounds not good because you have to compute offset by yourself, but caffe now provide NetSpec which you can generate net prototxt file by a python script, in NetSpec it will compute the crop layer offset automatically, I think this is a good solution which avoid modifying the C++ layer implementations and provide automatically offset computation. Berkeley.FCN is a example of NetSpec script that generate net prototxt file which contain a crop layer, and here is my reimplementation of HED network in NetSpec, it is totally compatitable with the newest version of caffe. |
adding |
@stevendbrown @s9xie The new ported caffe works and the build is successful 👍. But the edges are not as clear as they should be like the original HED caffe. Is there anyway to make them more accurate? |
@stevendbrown hai ,I clone your git code,but when I run ./solver , I get Nan . it's ok when I run s9xie's |
@stevendbrown Hi I used your caffe to train hed. However, the output looks all dark. I changed pad from 35 to 1 in train_val and deploy. Did I miss anything? Can you share your train_val.prototxt? |
@zeakey |
@zeakey |
@zeakey |
@zeakey |
@hustzxl |
Hi all, I've reimplemented hed based on new caffe, check out it here https://github.com/zeakey/hed! |
@zeakey |
The HED uses an old caffe, which is not compatible with the latest CUDNN v5 (2x faster reported by NVIDIA).
If only for testing, after some investigation, it seems that HED uses no specific layers, so it will run the edge detection work and it is.
Except that I have found the boundaries are shift to the right bottom part, as shown below. After I change the pad value of the first layer to 1 from 35, the shift is corrected, but the boarder of the images is also detected as edges.
I have compare the cpp files with caffe repo, I have found several difference parts, e.g. something related to image label map data, data transform. But I don't see any critical modifications with the conv layers. So would you give me some hints of how to solve this problem?
Image
with pad 35
with pad 1
The text was updated successfully, but these errors were encountered: