CSAILVision / CSAILVision/places365

Place205 VS Place365 mean pixel subtraction

Open
#74 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.1k
Forks
538
PR merge metrics
No merged PRs in 30d

Description

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](places.csail.mit.edu/model/places205vgg.tar.gz):

`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,

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.