crfasrnn icon indicating copy to clipboard operation
crfasrnn copied to clipboard

Mean vector

Open AlexTS1980 opened this issue 6 years ago • 0 comments

In the code

    #PIL reads image in the form of RGB, while cv2 reads image in the form of BGR, mean_vec = [R,G,B] 
    mean_vec = np.array([123.68, 116.779, 103.939], dtype=np.float32)
    mean_vec = mean_vec.reshape(1, 1, 3)

    # Rearrange channels to form BGR
    im = image[:, :, ::-1]
    # Subtract mean
    im = im - mean_vec

I think it's a typo, should read mean_vec = [B,G,R] becauase caffe.io.load_image loads image as RGB, then you transform it to BGR and then subtract the means.

AlexTS1980 avatar Oct 09 '17 17:10 AlexTS1980