Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mean vector #147

Open
AlexTS1980 opened this issue Oct 9, 2017 · 0 comments
Open

Mean vector #147

AlexTS1980 opened this issue Oct 9, 2017 · 0 comments

Comments

@AlexTS1980
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant