yun-liu / RCF

Richer Convolutional Features for Edge Detection
Other
753 stars 259 forks source link

Got error wile running RCF-singlescale.pynb #30

Open athiselvam opened 6 years ago

athiselvam commented 6 years ago

Hi @yun-liu ,

I tried to find edges of my own image from NYUD trained model using RCF-singlescale.pynb.

But when I tried to convert image numpy array and subtract array from the image I got the following error.

The following code I was trying to execute

**_im_lst = [] for i in range(0, len(test_lst)):

print data_root+test_lst[i]

im = Image.open(data_root+test_lst[i])
#im.show()
in_ = np.array(im, dtype=np.float32)
in_ = in_[:,:,::-1]
#print in_
in_ -= np.array((104.00698793,116.66876762,122.67891434))
im_lst.append(in_)_**

The following error I got:

**_--------------------------------------------------------------------------- ValueError Traceback (most recent call last)

in () 7 in_ = in_[:,:,::-1] 8 #print in_ ----> 9 in_ -= np.array((104.00698793,116.66876762,122.67891434)) 10 im_lst.append(in_) ValueError: operands could not be broadcast together with shapes (365,492,4) (3,) (365,492,4)_**
yun-liu commented 6 years ago

It seems that your input image has four channels (maybe RGB-Alpha), but it subtracts to a 3-dimension vector.