JingchunCheng / SegFlow

Demo code of the paper "SegFlow: Joint Learning for Video Object Segmentation and Optical Flow", in ICCV 2017
178 stars 41 forks source link

Got all black segmentation results by parent net demo #2

Closed Wei-TianHao closed 7 years ago

Wei-TianHao commented 7 years ago

Hi, Jingchun. I use python infer_DAVIS.py dog to test the parent net. And got all black images. All the outputs are zeros. I tried other class and got the same result.

JingchunCheng commented 7 years ago

@Wei-TianHao Hi, TianHao,

The output images seem all black because the demo outputs results with values of 0 and 1. You can add (*255) in line 85 and try again.

85 out1 = net.blobs['score'].data[0].argmax(axis=0)*255

Wish you the best. ^_^

Wei-TianHao commented 7 years ago

Actually, I use np.sum to count the output and got a 0. I tried *255 and still got an all black image. I use print('res2a sum = ', np.sum(net.blobs['res2a'].data[0])) to check the net and got ('res2a sum = ', nan). May you please kindly check the SegFlow.caffemodel you released?

Wei-TianHao commented 7 years ago

@JingchunCheng

wasidennis commented 7 years ago

Hi @Wei-TianHao

We can run our model smoothly on various machines. Could you please verify that caffe (contained in this repository) is installed completely, and the inputs are all read correctly? Thanks a lot and we look forward to your feedback.

Wei-TianHao commented 7 years ago

Hi, @JingchunCheng I re-cloned this repository and re-installed the caffe contained. I still got the same result. I checked the input and found it as expected. And I also checked the score layer and found that the value in 0 class are all positive while those in 1 class are all negative. Here is the result. It's wired.

before transforming
image shape = (480, 854, 3)
image[50,50] =  [ 150.  148.  153.]
image[100,100] =  [ 155.  136.  122.]

after transforming
image shape = (3, 480, 854)
image[50,50] =  [ 48.99301147  31.33123207  27.32108498]
image[100,100] =  [ 17.99301147  19.33123207  32.32108688]

score statistic
('score shape = ', (2, 480, 854))
('score 0 mean = ', 0.67816013)
('score 0 max = ', 0.71109509)
('score 0 min = ', 0.010947684)
('score 1 mean = ', -0.67816097)
('score 1 max = ', -0.010947689)
('score 1 min = ', -0.71109569)
../data/DAVIS//JPEGImages/480p/dog/00003.jpg
out1 shape = (480, 854)
out1 data sample =  
[[0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]]
JingchunCheng commented 7 years ago

@Wei-TianHao Did you change any layer in deploy.prototxt? The scores are not supposed to be in the range [0, 1] in this demo...

For the video "dog", our output is: " Class dog: Total number of images = 60 ../results/Res_SegFlow//dog/00000.mat #output_name_1 ../results/Res_SegFlow//dog/00000.jpg #output_name_2 loading /home/jingchun/DeepParticle-master/data/DAVIS//JPEGImages/480p/dog/00000.jpg #input_img_1 loading /home/jingchun/DeepParticle-master/data/DAVIS//JPEGImages/480p/dog/00001.jpg #input_img_2 /home/jingchun/DeepParticle-master/data/DAVIS//JPEGImages/480p/dog/00001.jpg #predicting for img_2 range of axis 0: [-4.27660989761 , 2616.28857422] #range of value for segmentation score[0] range of axis 1: [-2616.28881836 , 4.27658462524] #range of value for segmentation score[1] ... " And the output images are like: 00000 00003

Wei-TianHao commented 7 years ago

I never modified anything except the Makefile.config from caffe. I changed the CUDA_ARCH and some search paths.

Wei-TianHao commented 7 years ago

I tried on another machine and got the expected results. Thanks for your help! Do you have any idea where the problem might be? Any suggestions will be appreciated.

wasidennis commented 7 years ago

Thanks for your updates. I am not sure the reason in your case, but I have also struggled with unexpected results before, mainly caused by dependencies in terms of version or installation process. Usually they would need to be re-installed to resolve the issues.

Anyway, I hope our work will benefit your study!

Wei-TianHao commented 7 years ago

Hi @JingchunCheng @wasidennis , I figured out where the problem is! It's related to the cuda version. I degraded the cuda version to 7.5 and got the right results!