Giter Site home page Giter Site logo

bdcn's Introduction

  • 👋 Hi, I’m @pkuCactus
  • 👀 I’m interested in semantic segmentatio, object detection and ed edge detection
  • 🌱 I’m currently learning how to luodi
  • 💞️ I’m looking to collaborate on shangye luodi
  • 📫 How to reach me home.jianzhonghe.cn

bdcn's People

Contributors

pkucactus avatar stephenwithav 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  avatar  avatar  avatar  avatar  avatar

bdcn's Issues

Model file download location

Thanks for your excellent research and for releasing the source code. Would it be possible to upload the pretrained model files to another provider? It is very difficult (sometimes impossible) to access baidu from outside of China.

Non-Maximum Suppression

Hi, I think it is a very great work. I wonder if you could give me the implemention of Non-Maximum Suppression? I have not found the Non-Maximum Suppression in the released code, did I not find it? thank you!

Error running test.py script

Hello, thanks for your sharing. I am very interested in your work.I ran the code you Shared. The training script worked perfectly on different data sets, but the test script didn't.train.txt file has two columns of image list, at this time, the file test.txt only has one column of image list, does the file test.txt also need two columns of image list?,Besides, shouldn't testing the effect of edge detection be done on color images?Shouldn't gt images be required?Looking forward to your reply!

what's error?

python train.py

FileNotFoundError: [Errno 2] No such file or directory: 'path_to/bsds500/HED-BSDS/train_pair.lst'

about the SEM output shape

Hello Mr. Author,
I have a question that why the SEM dim-1 output is 21 and not equals to the powers of 2?

Python 2.7?

Why is a 2019 repository based on Python 2.7 which is almost deprecated? Is there some special functionality which is not present in newer Python versions?

Why use different lr for each layer? Not converge problem.

Hi @pkuCactus
I'm just read your paper. Your idea is very interesting and shows a very good performance. However, when I try to use your dataset, I saw you use different learning rates for each layer? Does this improve the performance a lot?
I'm trying to deal with my datasets with diferent edge detection methods. I tried RCF and yours. RCF works find but yours found loss doesn't decrease much and accuracy doesn't improve much, even though I used pre-trained weights and learning rate decease(0.1) on the plateau. I have my own data preprocessed in a slightly different way. When I try RCF, just replace network part with RCF and change the weighted loss function, optimiser. Yours seems more complex: I switch from RCF to BDCN add sigmoid on results, use RCF loss(cause I think yours and RCF just different on sigmoid location), use different learning rate for each layer. I have inputs of 37272 and labels (1,72,72) batch size originally set 64 for RCF. Now batch size set to 16 iterator size is 1. Since my image is smaller I also tuned the atrous convolution rate from 4 to 3.
My dataset is seismic images.
Do you have any insights that why my model not converge? Really appreciate your help.

Thanks

About the mean_bgr [104.00699, 116.66877, 122.67892]

Hi.Thank you for your amazing work. I'm confused about the line "img -=self.mean_bgr". Since I find the same operation in RCF code and I guess the mean_bgr equals to [104.00699, 116.66877, 122.67892] is the pixel mean value of BSDS500 dataset, and by which you can center the data. Actually, I calculated the mean value of images from BSDS500 training set and it's not same with [104.00699, 116.66877, 122.67892].
So I search "104.00699, 116.66877, 122.67892" on Internet and the earliest source is from FCN github, and the training dataset used is Pascal VOC2012. Would you mind explaining how you get [104.00699, 116.66877, 122.67892]?

I'm sorry to bother you,but I have some questions...

@pkuCactus

Hi,

What an awesome job! I have some questions in the sketch of the places2 dataset(256 * 256).How should I modify the parameter of yita in config.py?Could it work on the places2 dataset?How long does it cost if I want to get the edge flist form the whole places2 dataset?

I would very appreciate if you could help me,thank you!

Thanks,

test error

Hi, @pkuCactus ,I just want to test on the BSD500 dataset,so when I installed the requirement I modified the path of test dataset and 'voc.txt',I just change it to 'test.lst',but It occured error,like this:
Exception: KeyError:Traceback (most recent call last):
File "/home/jia/anaconda3/envs/bdcn/lib/python2.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/jia/pycode/BDCN-master/datasets/dataset.py", line 52, in getitem
img = load_image_with_cache(img_file, self.cache)
File "/home/jia/pycode/BDCN-master/datasets/dataset.py", line 18, in load_image_with_cache
return Image.open(StringIO(cache[path]))
KeyError: '/home/jia/pycode/BDCN-master/data/test/100007.jpg'

so could you give me some advice,hope your reply,Thanks very much.

训练速度很慢

您好,我对您的论文很感兴趣, 现在在尝试跑您这份代码,但是loss.backword()的时候大概每张图需要0.6s, batch_size 设置为1时,每个iteration需要6s左右,我的显卡是1080Ti,系统是Ubuntu16.04. 请问您在训练的时候速度也是这么慢吗?

License

Could you add license (e.g., MIT) for this repository?

The trained module?

Hello, I want to be a multi-tasking learning network that assists stereo matching with edge detection information. However, the stereo matching data set does not have GT edge information, so I want to use your trained model to directly apply to generate edge information. I can download it directly according to the link you gave? The link seems to be invalid. Can you send me one more, thank you.

The maximum tolerance

Dear @pkuCactus,
thanks for sharing the code and the paper. I have a naive question :( (I think), in page 5 of your paper: "The maximum tolerance allowed for correct matches between edge predictions and groundtruth annotations is set to 0.0075 for BSDS500 and Multicue dataset, and is set to 0.011 for NYUDv2 dataset". Could you please explain to me about it, and tell me where are you doing this?

Thanks in advance

Training and Resuming

Can someone explain me how to train and resume from a pretrained model, e.g. I used the available pretrained bsds500 model, than I added my new data dir in cfg.py under the bsds500 key and started the training with

python train.py -p models/bdcn_pretrained_on_bsds500.pth -c --complete_pretrain models/bdcn_algo_on_bsds500.pth

I stopped and now I want to continue the training on the same parameter setting but from the latest point stored in params, can someone tell me how to do that? I saw there exists the --resume parameter and tried out different execution combinations but they all ended in an error (KeyError: 'step').

Big thanks in advance!

MULTICUE checkpoint

Dear @pkuCactus,
thanks again for your work. Please, could you provide us the checkpoint trained in the Multicue dataset?

Cheers,

Xavier

pretrained model dose not work

so sorry to bother you.
I test the pretrained model you provide but it doesnot work.
generate edge that looks like this.Maybe it is not right.Would you mind giving me some advice?
Thanks a lot
image

Why batch_size =1 ?

I would like to ask why batch_size=1?I believe this may be the best result of tuning parameters, Is it because the model has an image with a gray background?

Training Memory Consumption

Is it possible to train with a Nvidia GTX 1080 Ti with 11GB GDDR RAM? I always run out of memory but installed your recommended software via conda. Without CUDA support my system has peaks around 20GB RAM and I don't know if this is also too much. If you use your graphic card for learning can you tell me your configuration?

My settings: Ubuntu 16.04 LTS, Nvidia Driver: 418.67, Cuda: 9.2

Big thanks in advance!

关于损失形式的一个疑惑

您好。机缘巧合看到您的论文。在阅读其中的损失相关的内容的时候,我思考了这样一个问题:

本文的设计期望不同的尺度可以生成具有差异性的预测效果。
公式4中的分析是基于预测结果直接相加后得到的整体预测与原始真值计算损失的情况。这种情况下,各层之间的梯度是没有差异的。应为毕竟是权重为1的加和。如果这里使用带权重的加和,那么梯度也就不一样了。指定的权重则成了为比例值。
但当我看到后面给出的新损失的计算形式,即公式9的时候,我觉得,这里公式4所假设的情况,似乎并不是最合适。作为对比,更合适的应该是分开计算损失后加和的形式。
后者的计算实际上涉及到两种可能,即需要考虑各层真值的构造方式。

  1. 如果仅仅利用其它层的预测值并截断梯度的话,那么各层的真值不同,就可以获得更近似于本文需求的监督状态。
  2. 如果对其它层的梯度仍然保留的话,那情况就更复杂了。对于一层的预测,其梯度不仅和当前层预测有关,和其它层的预测同样相关。 按照后文使用交叉熵损失时,那么其它层对当前层预测的梯度,就需要通过其它层损失对各层真值部分求偏导数获得(这里的真值实际上是非二值的,因为利用了其它层的预测图来近似构造)。这与当前层损失直接对预测部分偏导形式不同(当前层损失通过链式法则,从本层的近似真值传递的梯度是无法流向本层的预测的)。所以显然,不同层的梯度同样是不同的。

不知思考是否正确,希望得到您的解答。

Some questions about large training loss

Hi, I download you code and BSDS500 dataset to learn edge detection model and print the loss of each iteration, however, the training losses are very large and keep increasing which indicate that the model is not converge. I just keep the default parameters, can you give me any hints to solve these problems?

why stop gradients on upsample

o1, o2, o3, o4, o5 = s1.detach(), s2.detach(), s3.detach(), s4.detach(), s5.detach() o11, o21, o31, o41, o51 = s11.detach(), s21.detach(), s31.detach(), s41.detach(), s51.detach()
why do you use detach here? you mean that VGG's parameter is freezen?

Random seed Problem

作者您好,从代码中我发现您使用设置的随机种子time.time(),这会导致每次训练时初始化情况不一样。在训练时,我发现在不同的时间开始训练可能会影响网络的收敛情况,从而直接影响网络得到的效果,所以并没有得到作者在论文中提出的效果。请问作者在训练时会遇到这个问题吗?

About the data augmentation of PASCAL Context dataset?

Hi @pkuCactus
From your paper, I have knew that using the PASCAL Context dataset as additional training dataset can help improve the performance( ODS 0.806 -> 0.820),so I wonder some training detail. Could your please tell me whether you augment the Pascal Context dataset while training?

Results not reproducible

Hi @pkuCactus ,

We tried to train model with help of vgg model shared in the https://drive.google.com/file/d/1CmDMypSlLM6EAvOt5yjwUQ7O5w-xCm1n/view?usp=sharing.

We are able to get ODS=0.798 OIS=0.813 at 40k iteration

Can you mention the reason for the large deviation in the results?
As per your paper, it must be ODS =0.806

We have used BSDS data alone for training the model.

Can you mention some tips or ideas to fix the issue.
We have used your code as such with minor modifications to support new version of torch.

Cannot find the caffe model

Hi,

I cannot find the caffe model in the model zoo, is it available elsewhere?

Thanks in advance,
Tristan

Implementation of supervision (Y s2d) or (Y d2s)

@pkuCactus
Hi pkuCactus, Thanks for share your code! I'm really interested in this paper.
But I still have some question about the Implementation of supervision (Y s2d) or (Y d2s).
image
For example, in 'd2s' path, the supervision of the first layer/stage is Y1_d2s = Y - P2 -P3 -P4 -P5, and in the code you use the loss L(P1+P2+P3+P4+P5, Y) where P2~5 is detach().
But why not get this supervision Y1_d2s directly using "Y - P2 -P3 -P4 -P5" ? i.e. implement the loss as L(P1, Y-P2-P3-P4-P5).
What I mean is that the loss function is not a simple subtraction between prediction and label, so I guess L(P1+P2+P3+P4+P5, Y) is not equivalent to L(P1, Y-P2-P3-P4-P5). Is that right?
Thanks for your answer!

Segmentation fault (core dumped)

Dear @pkuCactus, I just run the test.py , then it killed by printed "Segmentation fault (core dumped)" . On my PC Pillow is 5.1.0 , pytorch = 0.2.0_2, numpy=1.14.3. I have no idea to make this work ? Can you give me some ideas? THX

about the data

我是一个新手,我看您的数据需要BSDS500/data/test_pair.lst,我下载的BSD数据集,data文件中,只有groundTruth和images,请问是需要进行处理吗?您可以分享一下您制作好的数据集吗?我想尝试运行一下这个程序。

result

Hello, I am very interested in your work. I ran the test.py script and it passed. The result is as follows:
[1]runfile('/home/renxue/BDCN/test.py', wdir='/home/renxue/BDCN')
Time.struct_time(tm_year=2019, tm_mon=7, tm_mday=7, tm_hour=9, tm_min=15, tm_sec=6, tm_wday=6, tm_yday=188, tm_isdst=0)
Bdcn.py:199: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
   Nn.init.constant(param, 0.080)
(200, 200)
/home/renxue/anaconda3/envs/psenet/lib/python2.7/site-packages/torch/nn/functional.py:1332: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
   Warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
383.229988098
Overall Time use: 383.677251816
There is no visual result in the result/fuse folder. How can I solve this problem?
I look forward to your reply and wish you a happy life.

用自己生成的数据训练loss高

感谢开源,我按自己的理解生成了一批数据用来训练,但是好像不太正常,希望得到答复。
数据:自己生成的数据,image数据是规则形状(不同比例长方形)的黑色边框混合高斯噪音背景,gt数据与image数据对应的是黑底白边的边框。分辨率不统一,大概1500*1000左右。
训练:所有参数都按照代码默认,希望可以训练得到边框的预测值,但是训练的时候loss非常高。
问题:
1、我这样生成数据是否正确?
2、不知道是这么高的loss否正常?
3、不知道有什么建议?

训练输出如下:
2019-07-01 09:13:10 - 19327 - train - 165: - iter: 20, lr: 1.000000e-06, loss: 4542657.586670, time using: 268.832860(13.441643s/iter)
2019-07-01 09:17:27 - 19327 - train - 165: - iter: 40, lr: 1.000000e-06, loss: 5015165.073022, time using: 257.739118(12.886956s/iter)
2019-07-01 09:21:52 - 19327 - train - 165: - iter: 60, lr: 1.000000e-06, loss: 5451473.621562, time using: 264.798099(13.239905s/iter)
2019-07-01 09:26:12 - 19327 - train - 165: - iter: 80, lr: 1.000000e-06, loss: 5684060.033437, time using: 259.854109(12.992705s/iter)
2019-07-01 09:30:38 - 19327 - train - 165: - iter: 100, lr: 1.000000e-06, loss: 5733884.890625, time using: 265.694983(13.284749s/iter)
2019-07-01 09:34:51 - 19327 - train - 165: - iter: 120, lr: 1.000000e-06, loss: 5772163.593750, time using: 252.914639(12.645732s/iter)
2019-07-01 09:39:14 - 19327 - train - 165: - iter: 140, lr: 1.000000e-06, loss: 5874098.355625, time using: 263.307687(13.165384s/iter)
2019-07-01 09:43:42 - 19327 - train - 165: - iter: 160, lr: 1.000000e-06, loss: 5776728.520313, time using: 267.739432(13.386972s/iter)
2019-07-01 09:47:55 - 19327 - train - 165: - iter: 180, lr: 1.000000e-06, loss: 5788587.094688, time using: 252.926788(12.646339s/iter)
2019-07-01 09:52:04 - 19327 - train - 165: - iter: 200, lr: 1.000000e-06, loss: 5926115.983125, time using: 249.590764(12.479538s/iter)
2019-07-01 09:56:26 - 19327 - train - 165: - iter: 220, lr: 1.000000e-06, loss: 5850768.974375, time using: 261.717345(13.085867s/iter)
2019-07-01 10:00:35 - 19327 - train - 165: - iter: 240, lr: 1.000000e-06, loss: 5650565.324375, time using: 249.568756(12.478438s/iter)
2019-07-01 10:04:53 - 19327 - train - 165: - iter: 260, lr: 1.000000e-06, loss: 5777168.478438, time using: 257.734875(12.886744s/iter)
2019-07-01 10:09:16 - 19327 - train - 165: - iter: 280, lr: 1.000000e-06, loss: 5784601.113750, time using: 262.375716(13.118786s/iter)

links to datasets

hello there! :) I am in love with your work! I got some of the datasets from http://mftp.mmcheng.net/liuyun/rcf/data/ but unfortunately... I still seem to be getting data related errors for example...
'''
Traceback (most recent call last): File "/usr/local/python3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/usr/local/python3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp> samples = collate_fn([dataset[i] for i in batch_indices]) File "/BDCN-master/datasets/dataset.py", line 69, in __getitem__ img = load_image_with_cache(img_file, self.cache) File "/BDCN-master/datasets/dataset.py", line 34, in load_image_with_cache with open(path, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '/path_to/bsds500/HED-BSDS/train/aug_data_scale_1.5/247.5_1_0/144067.png'

'''
My aug_data_scale_1.5 does not have the file 247.5_1_0. I am not sure where I am going wrong.
If possible, may you please help me with links to the actual datasets you used in the experiments. This would be really helpful.

对比实验数据问题

在BSDS500数据集上,与HED,RCF等这些方法对比时,您是使用那些方法重新作了实验吗?

How to prepare test_pair.lst for test.py?

I downloaded the HED-BSDS dataset and placed it in the /BDCN directory.

I then downloaded the BSR dataset from https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/resources.html

I see in cfg.py for test_pair.lst, it says

'data_root': 'path_to/bsds500/BSR/BSDS500/data/',
'data_lst': 'test_pair.lst'

But there is no test_pair.lst in that BSR data set

Am I supposed to use the test.lst in the HED-BSDS to create test_pair.lst for /BSR/BSDS500/data/test_pair.lst? Or create my own test_pair.lst that looks something like below?

images/test/100007.jpg groundTruth/test/100007.mat
images/test/100039.jpg groundTruth/test/100039.mat
...

If I try the latter, I get an error in test.py:

assert len(testloader) == len(nm)

网络输出的第7,8,9,10维度输出纯灰白图像?(Output pure gray image in dimension 7,8,9,10 of network output?)

这个问题困扰了很久,检查损失计算应该也没问题.我对于下载的核心部分代码没有做任何修改,但是我每次对训练后的模型做测试的时候,一张图片的第7,8,9,10输出尺度都是灰白图像,好像没有起到训练效果.请问有人遇到同样的问题吗?这会是什么原因呢?你们是如何解决的?

This problem has been bothering me for a long time, and it should be OK to check the loss calculation. I didn't make any changes to the core part of the code downloaded, but every time I test the model after training, the 7th, 8th, 9th and 10th output scales of an image are gray, It doesn't seem to have any training effect. Does anyone encounter the same problem? What's the reason? How do you solve it?

dataset

Can you provide the groundtruth of NYUD?Thanks a lot.

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.