Code Monkey home page Code Monkey logo

hed's People

Contributors

xwjabc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hed's Issues

Good edge detector. I want to improve the thickness of edge line.

Hello. I have tested this code and have got good results. Thank you for sharing.
However, as I apply this code to my TEM images and get edge lines, the output images have rather thick edge lines.
So, I need to post-process those outputs to use in my actual job.
I need your idea. How can I get thinner edge lines from this algorithm?

question about using pre-trained caffe model

Hi I realized that you load pre-trained parameters of caffe.

I was wondering if using the pre-trained parameters of caffe is necessary because I want to try training with other datasets rather than BSD500 and I assume that if pre-trained parameters are used, my new datasets won't be able to give an effect.

Thank you :)

Add a license

Thanks so much for your implementation! It's been really helpful for understanding HED. Could you add a license for the code? That would make it more clear what you allow others to do with your code.

Problem

The functions of load_pretrained_caffe and load_vgg16_caffe have some difference? I don't know which one I should use? Can you give me some suggests?

The accuracy of the results

Hi,Following your code,I get the accuracy of the results ODS=0.786 OIS=0.804.It's inspiring.But AP = 0.797,which is far less than the official results(0.833).would you mind telling me your AP?Thanks

about 5stage-vgg.py36pickle

hello,Where I can download 5stage-vgg.py36pickle.I just can download 5stage-vgg.caffemodel from saining orignal caffe hed.

question about NMS

I find that the results of NMS are the concatenation of three images along the column, is that correct?

question about evaluate

Hi!Thanks for sharing this code! When I run your evaluation code:

python hed.py --checkpoint ./data/hed_checkpoint.pt --output ./output-mypretrain --test
cd eval
(echo "data_dir = '../output-mypretrain/test'"; cat eval_edge.m)|matlab -nodisplay -nodesktop -nosplash

I got this result:

ODS=0.381 OIS=0.386 AP=0.176 R50=0.020 - HED

That's confusing.
Is there some bugs in evaluation code or some considerations?
Thanks a lot.

about evaluation

image
HI I would like to know how the result of such a picture turns into the format of your picture so that it can be evaluated

Question about eval.

Thanks for your code!But I have a question, how to evaluate the result?I don't have any idea, thanks!

Question about output

Thank you for your code!
However,my output/epoch-#-train have 7 gray graphs,and the training process can be carried out without error reporting,looking forward to your reply!

Question about eval

您好,我在运行下面语句时有一些问题
cd eval
(echo "data_dir = '../output-mypretrain/test'"; cat eval_edge.m)|matlab -nodisplay -nodesktop -nosplash
这个语句怎么用?我在运行时直接复制您的这条语句运行?还是需要自己先创建一些文件?

When I reduce the number of samples, the following problems will occur

Traceback (most recent call last):
File "hed.py", line 309, in
main()
File "hed.py", line 189, in main
train(train_loader, net, opt, lr_schd, epoch, save_dir=join(output_dir, 'epoch-{}-train'.format(epoch)))
File "hed.py", line 214, in train
for batch_index, (images, edges) in enumerate(tqdm(train_loader)):
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\tqdm\std.py", line 1195, in iter
for obj in iterable:
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "F:\hed\datasets.py", line 43, in getitem
edge = edge[np.newaxis, :, :] # Add one channel at first (CHW).
TypeError: 'NoneType' object is not subscriptable

About training

I trained on my own data set, and the following result graph appeared (I am doing a binary classification task). How can I improve it? Please answer
image

About eval

想请问在评测代码里面,是否对真值进行了二值化,以及在运行评测标准时,会计算人类的标准,大概score是0.8,这个是如何计算的?还有个问题是bsds500上面的原数据是由七个人标注,然后融合取平均,那在测试集上也是拿平均后的真值去评测的吗?

Invalid MEX file: correspondPixels.mexmaci64

Hello,

I'm trying to use your evaluation code on MATLAB (r2019b) on mac os x but I get this error:
Error using edgesEvalImg (line 70) Invalid MEX-file '/Users/antoninsumner/Documents/GitHub/EdgeDetection_ModelsComparison/eval/edges/private2/correspondPixels.mexmaci64': dlopen(/Users/antoninsumner/Documents/GitHub/EdgeDetection_ModelsComparison/eval/edges/private2/correspondPixels.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib Referenced from: /Users/antoninsumner/Documents/GitHub/EdgeDetection_ModelsComparison/eval/edges/private2/correspondPixels.mexmaci64

Apparently this is due to the use of @loader_path/libmex.dylib
@loader_path seems to be depreciated and @rpath should be used instead.
https://stackoverflow.com/a/48473295/6752124

Do you think you can re-compile the correspondPixels.mexmaci64 file with @rpath or maybe provide the original MATLAB code?

Thank you

About results

I used my own dataset but the result was strange and the VGG pretrained model I also used. Can you give me some advice?I have tried it so many times
image

load pretrained model : pickle.UnpicklingError: invalid load key, '\x0a'

File "hed.py", line 302, in
main()
File "hed.py", line 156, in main
load_vgg16_caffe(net, args.vgg16_caffe)
File "D:\Application\Object_Detection\hed-master\utils.py", line 87, in load_vgg16_caffe
load_pretrained_caffe(net, path, only_vgg=True)
File "D:\Application\Object_Detection\hed-master\utils.py", line 94, in load_pretrained_caffe
pretrained_params = pickle.load(f)
_pickle.UnpicklingError: invalid load key, '\x0a'.

new datset train

hi ! I try to trained the model on another dataset BIPED. However i met similar problems with issue 36 but not same. I already used the pretrained model. But for my trainning output, only the fifth and sixth output images are white. I don't know what is the problem and how to fix it.

padding=35 in first conv layer

Hi,
Nice repo. What is the reason for keeping padding=35 for the first convolutional layer?
I am not sure if the HED architecture advises that.

question ablout hed_pretrained_bsds.py36pickle

Thanks for this progect!
My compilation for Caffe or modified HED doesn't sussess. I noticed cafffemodel can be converted into pickle with some tools. But it still uses Caffe as Dependency.
Could you upload "hed_pretrained_bsds.py36pickle" file?
Thanks for your help.

About the datasets

What should the composition of the data set folder look like? What does the .lst file do? Beginners ask for advice

issues about the learning rate

Thanks for sharing your code and it works well.

I have some doubts about the learning rate. Why learning rate for conv5 is 100x of base learning rate, and classification layer(dsns) is 0.01x of base learning rate? For fune-tuning, learning rate for classification layer(which is trained from scratch) is usually set 10x compared to the backbone network parameters, right?

Besides, if I insert new layers into hed, how should I set the learning rate for them?

Question about training!

When I train the model, the test result of image is gray and all the value in the mat is 0.5. Is there some error when I train the model with pycharm?

Evaluate the result.

I have got the correct nms result. But it seems my ground-truth loading part hsas bug,but I don't know whats' the problem.my ground-truth edge is 255,and non-edge is 0,ist hat right?And the _ev1.txt is like this:
0.01 5411 7637.75 5411 5464
0.02 5411 7637.75 5411 5464
0.03 5411 7637.75 5411 5464
0.04 5411 7637.75 5411 5464
0.05 5411 7637.75 5411 5464
0.06 5411 7637.75 5411 5464
0.07 5409 7637.75 5409 5462
0.08 5409 7637.75 5409 5462
0.09 5409 7637.75 5409 5462
0.1 5409 7637.75 5409 5462
0.11 5409 7637.75 5409 5462
0.12 5409 7637.75 5409 5462
0.13 5402 7637.75 5402 5455
0.14 5402 7637.75 5402 5455
0.15 5402 7637.75 5402 5455
0.16 5402 7637.75 5402 5455
0.17 5402 7637.75 5402 5455
0.18 5402 7637.75 5402 5455
0.19 5400 7637.75 5400 5452
0.2 5400 7637.75 5400 5452
0.21 5400 7637.75 5400 5452

And the AP is very small and the P-R curve is not correct.

Question about evaluation metric

Hi, The code to compute evaluation metric is matlab-based in your repo.
Do you have any evaluate code in python? I want to compute the metric in training process.

Question about data preprocessing

Hello, could you tell me how to generate the ground-truth edge image? I want to evaluate hed on my own dataset.
For the open BSDS dataset, the ground-truth is described by .mat file.

Weights initialization in the 1x1 conv

Hi @xwjabc
Thanks for your contribution, I have a question just in the line below:

else:
                # Zero initialization following official repository.
                # Reference: hed/docs/tutorial/layers.md
m.weight.data.zero_() 

I see that you have used tensorflow too, so this weight initializer is something like
tf.truncated_normal_initializer(mean=0.) or tf.constant_initializer(0.0)

Thanks in advance
xavysp

hed/hed.py

Line 100 in c8ed5ab

m.weight.data.zero_()

questions about the visualization

Thank you for this elegent project ! I am trying to train a HED model using my own dataset. All the hyper-parameters are followed by this project and the results is also reasonable. However, the fifth side outputs of all the test image (shown below) are almost gray, which confuses me greatly. Could you have some ideas about this scenario?

batch-499-1st-image

batch-499-1st-image
batch-499-1st-image

Training

image
I used my own data set, but the result was a black image with all 0.5 values. How should I improve it?

evaluation of edge result on NYUD dataset

Thanks for your great work and kind sharing.

Have you ever test your model on NYU depth dataset? I came up against a problem in this step.

I could not find the NYUD edge ground truth file after training on its training sets, could you please give me any advice?

Thanks in advance.

about the edge_lable

when the net get the edge_lable :
edge[edge < 127.5] = 0.0
edge[edge >= 127.5] = 1.0

but i found that after filtering, most pixels become 0 like:
image
Will this affect the training?
thank you!

The reproduced results are relatively poor

Hello, I reproduced the code according to your steps, but the training results are ODS: 0.755, OIS: 0.773, AP: 0.650, which is different from your results. What's the problem?

About the aligned crop

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?

its about DeepFashion2

Sorry to write here about DeepFashion2 I was seeing your comments on DeepFashion2 you have trained model. Can you guide how to train DeepFashion2 I tried it but it was confusing.

Question about eval

Snipaste_2020-12-09_18-17-33
Thanks for your code,but I when I eval,this error comes out,I want to know how to fix it,thank you!

about vgg16

If there is no weight of VGG16, the network does not seem to be able to train the results. Why? If I do not use the pre-trained weight file, how should I get an ideal result? Does the blogger have suggestions or have they implemented it?

Question about average_batch_loss

Thanks for your code and the model I trained is quite good(ODS=0.788.OIS=0.806)。 I just have a question when i see the log during the training,the epoch average batch_loss maintains at around 1700 after 5th epoch ,until the end. Does this mean that the model does not converge?

about weight

Hello, why do you want to add the weight initialization function? What is its main function? Can it be omitted? After I added this, the effect felt worse
image

About loss

I have a question. The training loss of the HED network is relatively large, thousands or even higher, but the result is not bad. Why is the loss of the HED relatively large? Under normal circumstances, loss should be a very small value.

Question

When we evaluate the result,we need to run the EdgeEvalDir.m,but what's the meaning of maxDist. I am confused about it and there isn't code.Can you explian it or give some papers to explain it?
Thanks a lot!

Question about outputting 5 side-outputs

Hello, thanks for sharing! I want to get the five side-outputs however Pytorch is different to caffe. Is
there any suggestions? Thanks a lot! Looking forward to your reply!

batch-size >1 possible for training?

Hi @xwjabc,

Thanks for your code!

Could you please tell me if it is possible to have a higher batch-size (>1) for training? I see that when I try this out, I get the following error -
upsample2 = torch.nn.functional.conv_transpose2d(score_dsn2, self.weight_deconv2, stride=2)
Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'

Just wondering if you know this already.

Thanks,
AA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.