yuxng / PoseCNN

A Convolutional Neural Network for 6D Object Pose Estimation in Cluttered Scenes
https://rse-lab.cs.washington.edu/projects/posecnn/
MIT License
746 stars 242 forks source link

demo error #78

Open iris0329 opened 5 years ago

iris0329 commented 5 years ago

error

when I run the demo, I meet the problem:

Traceback (most recent call last):
  File "/data/poseCNN2/tools/demo.py", line 140, in <module>
    test_net_images(sess, network, imdb, weights_filename, rgb_filenames, depth_filenames, meta_data)
  File "/data/poseCNN2/tools/../lib/fcn/test.py", line 1914, in test_net_images
    labels, probs, vertex_pred, rois, poses = im_segment_single_frame(sess, net, im, im_depth, meta_data, voxelizer, imdb._extents, imdb._points_all, imdb._symmetry, imdb.num_classes)
  File "/data/poseCNN2/tools/../lib/fcn/test.py", line 124, in im_segment_single_frame
    im_blob, im_rescale_blob, im_depth_blob, im_normal_blob, im_scale_factors = _get_image_blob(im, im_depth, meta_data)
  File "/data/poseCNN2/tools/../lib/fcn/test.py", line 64, in _get_image_blob
    im_orig -= cfg.PIXEL_MEANS  #     has error, so i comment this line
ValueError: operands could not be broadcast together with shapes (480,640) (1,1,3) (480,640) 

file

when I trace back to the File "/data/poseCNN2/tools/../lib/fcn/test.py", line 64 is: im_orig -= cfg.PIXEL_MEANS

configure file

/experiments/cfgs/lov_color_2d.yml

others

('shape of img=', (480, 640))
('shape of rgba=', (480, 640))
('im_depth=', (480, 640))
('im_orig=', (480, 640))
('cfg.PIXEL_MEANS shape=', (1, 1, 3))
('cfg.PIXEL_MEANS =', array([[[102.9801, 115.9465, 122.7717]]]))

it seems arrays of different shape cannot have Subtraction operation, I cannot read the alpha channel of demo images, why? i am confusing...... thanks for help!

iris0329 commented 5 years ago

update

I change the test.py file:

        # img=cv2.imread(depth_file, cv2.IMREAD_UNCHANGED)
        img=cv2.imread(depth_file)
        rgba = pad_im(img, 16)

now the image is (480,640,3) , the demo can run successfully, still don't cantain the alpha channel, is that ok ? i am not sure.