crfasrnn
crfasrnn copied to clipboard
Mean vector
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.