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

Place205 VS Place365 mean pixel subtraction #74

Open
mrgransky opened this issue Feb 17, 2020 · 0 comments
Open

Place205 VS Place365 mean pixel subtraction #74

mrgransky opened this issue Feb 17, 2020 · 0 comments

Comments

@mrgransky
Copy link

mrgransky commented Feb 17, 2020

In Place205, input images are zero-centered by mean pixel (rather than mean image) subtraction with the following values explained in readme.txt file when downloaded here:

mu = np.array([105.487823486, 113.741088867, 116.060394287])

The following function with places365CNN_mean.binaryproto:

def load_mean_file(mean_file):
        if mean_file.endswith('.npy'):
	    return np.load(mean_file)
        with open(mean_file, 'rb') as infile:
            blob = caffe_pb2.BlobProto()
            blob.MergeFromString(infile.read())
            if blob.HasField('shape'):
                blob_dims = blob.shape
                assert len(blob_dims) == 4, 'Shape should have 4 dimensions - shape is "%s"' % blob.shape
            elif blob.HasField('num') and blob.HasField('channels') and \
                    blob.HasField('height') and blob.HasField('width'):
                blob_dims = (blob.num, blob.channels, blob.height, blob.width)
            else:
                raise ValueError('blob does not provide shape or 4d dimensions')
            mean=np.reshape(blob.data, blob_dims[1:])
        return mean 

returns: mu = np.array([104.05100722, 112.51448911, 116.67603893])

I was just wondering if this mean value for Place365 dataset seems correct?

Cheers,

@mrgransky mrgransky changed the title Place205 VS Place365 Place205 VS Place365 mean pixel subtraction Feb 17, 2020
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