{"action":"closed","number":2527,"pull_request":{"url":"https://api.github.com/repos/BVLC/caffe/pulls/2527","id":36557841,"html_url":"https://github.com/BVLC/caffe/pull/2527","diff_url":"https://github.com/BVLC/caffe/pull/2527.diff","patch_url":"https://github.com/BVLC/caffe/pull/2527.patch","issue_url":"https://api.github.com/repos/BVLC/caffe/issues/2527","number":2527,"state":"closed","locked":false,"title":"Update ilsvrc_2012_mean.mat to W x H x C, update demo and add comments","user":{"login":"ronghanghu","id":6997335,"avatar_url":"https://avatars.githubusercontent.com/u/6997335?v=3","gravatar_id":"","url":"https://api.github.com/users/ronghanghu","html_url":"https://github.com/ronghanghu","followers_url":"https://api.github.com/users/ronghanghu/followers","following_url":"https://api.github.com/users/ronghanghu/following{/other_user}","gists_url":"https://api.github.com/users/ronghanghu/gists{/gist_id}","starred_url":"https://api.github.com/users/ronghanghu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronghanghu/subscriptions","organizations_url":"https://api.github.com/users/ronghanghu/orgs","repos_url":"https://api.github.com/users/ronghanghu/repos","events_url":"https://api.github.com/users/ronghanghu/events{/privacy}","received_events_url":"https://api.github.com/users/ronghanghu/received_events","type":"User","site_admin":false},"body":"This PR addresses https://github.com/BVLC/caffe/pull/2505#issuecomment-106773895\r\n\r\nFor mean subtraction, note that caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat, which is inherited from old wrapper, contains `image_mean` variable in **height x width x 3**, BGR channels. However, `caffe.io.read_mean(./data/ilsvrc12/imagenet_mean.binaryproto)`, which is also inherited from old wrapper, returns `mean_data` in **width x height x 3**, also BGR channels, which is consistent with the way a caffe's blob stores data.\r\n\r\nAlthough classification_demo.m works correctly right now, one potential issue is that `image_mean` variable in ./matlab/+caffe/imagenet/ilsvrc_2012_mean.mat (inherited from old matcaffe) is in height x width x 3, which is inconsistent with width x height x 3 returned by `caffe.io.read_mean(path_to_mean_protobin)` and inconsistent with Caffe's data format. Although this issue also existed in the old Matlab wrapper as discussed at above, it should be addressed somehow.\r\n\r\nSo this PR permute height and width in caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat and update classification_demo.m. Use a new variable name s`mean_data` instead of `image_mean` in that file. Also, some comments are added in classification_demo.m and caffe.io.m (and also handle grayscale images).","created_at":"2015-05-30T01:49:33Z","updated_at":"2015-05-30T03:08:26Z","closed_at":"2015-05-30T03:08:26Z","merged_at":null,"merge_commit_sha":"a9b6a3a7d6c66a7c18ba607fb936b90a89db1f56","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BVLC/caffe/pulls/2527/commits","review_comments_url":"https://api.github.com/repos/BVLC/caffe/pulls/2527/comments","review_comment_url":"https://api.github.com/repos/BVLC/caffe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/2527/comments","statuses_url":"https://api.github.com/repos/BVLC/caffe/statuses/cb3cb25accbc976c4791882854d47ca9cab14e78","head":{"label":"ronghanghu:matcaffe-update-mean-format","ref":"matcaffe-update-mean-format","sha":"cb3cb25accbc976c4791882854d47ca9cab14e78","user":{"login":"ronghanghu","id":6997335,"avatar_url":"https://avatars.githubusercontent.com/u/6997335?v=3","gravatar_id":"","url":"https://api.github.com/users/ronghanghu","html_url":"https://github.com/ronghanghu","followers_url":"https://api.github.com/users/ronghanghu/followers","following_url":"https://api.github.com/users/ronghanghu/following{/other_user}","gists_url":"https://api.github.com/users/ronghanghu/gists{/gist_id}","starred_url":"https://api.github.com/users/ronghanghu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronghanghu/subscriptions","organizations_url":"https://api.github.com/users/ronghanghu/orgs","repos_url":"https://api.github.com/users/ronghanghu/repos","events_url":"https://api.github.com/users/ronghanghu/events{/privacy}","received_events_url":"https://api.github.com/users/ronghanghu/received_events","type":"User","site_admin":false},"repo":{"id":21477875,"name":"caffe","full_name":"ronghanghu/caffe","owner":{"login":"ronghanghu","id":6997335,"avatar_url":"https://avatars.githubusercontent.com/u/6997335?v=3","gravatar_id":"","url":"https://api.github.com/users/ronghanghu","html_url":"https://github.com/ronghanghu","followers_url":"https://api.github.com/users/ronghanghu/followers","following_url":"https://api.github.com/users/ronghanghu/following{/other_user}","gists_url":"https://api.github.com/users/ronghanghu/gists{/gist_id}","starred_url":"https://api.github.com/users/ronghanghu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronghanghu/subscriptions","organizations_url":"https://api.github.com/users/ronghanghu/orgs","repos_url":"https://api.github.com/users/ronghanghu/repos","events_url":"https://api.github.com/users/ronghanghu/events{/privacy}","received_events_url":"https://api.github.com/users/ronghanghu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ronghanghu/caffe","description":"Caffe: a Fast framework for neural networks. For the most recent version, check out branch dev. For a more stable version, check out branch master.","fork":true,"url":"https://api.github.com/repos/ronghanghu/caffe","forks_url":"https://api.github.com/repos/ronghanghu/caffe/forks","keys_url":"https://api.github.com/repos/ronghanghu/caffe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ronghanghu/caffe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ronghanghu/caffe/teams","hooks_url":"https://api.github.com/repos/ronghanghu/caffe/hooks","issue_events_url":"https://api.github.com/repos/ronghanghu/caffe/issues/events{/number}","events_url":"https://api.github.com/repos/ronghanghu/caffe/events","assignees_url":"https://api.github.com/repos/ronghanghu/caffe/assignees{/user}","branches_url":"https://api.github.com/repos/ronghanghu/caffe/branches{/branch}","tags_url":"https://api.github.com/repos/ronghanghu/caffe/tags","blobs_url":"https://api.github.com/repos/ronghanghu/caffe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ronghanghu/caffe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ronghanghu/caffe/git/refs{/sha}","trees_url":"https://api.github.com/repos/ronghanghu/caffe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ronghanghu/caffe/statuses/{sha}","languages_url":"https://api.github.com/repos/ronghanghu/caffe/languages","stargazers_url":"https://api.github.com/repos/ronghanghu/caffe/stargazers","contributors_url":"https://api.github.com/repos/ronghanghu/caffe/contributors","subscribers_url":"https://api.github.com/repos/ronghanghu/caffe/subscribers","subscription_url":"https://api.github.com/repos/ronghanghu/caffe/subscription","commits_url":"https://api.github.com/repos/ronghanghu/caffe/commits{/sha}","git_commits_url":"https://api.github.com/repos/ronghanghu/caffe/git/commits{/sha}","comments_url":"https://api.github.com/repos/ronghanghu/caffe/comments{/number}","issue_comment_url":"https://api.github.com/repos/ronghanghu/caffe/issues/comments{/number}","contents_url":"https://api.github.com/repos/ronghanghu/caffe/contents/{+path}","compare_url":"https://api.github.com/repos/ronghanghu/caffe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ronghanghu/caffe/merges","archive_url":"https://api.github.com/repos/ronghanghu/caffe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ronghanghu/caffe/downloads","issues_url":"https://api.github.com/repos/ronghanghu/caffe/issues{/number}","pulls_url":"https://api.github.com/repos/ronghanghu/caffe/pulls{/number}","milestones_url":"https://api.github.com/repos/ronghanghu/caffe/milestones{/number}","notifications_url":"https://api.github.com/repos/ronghanghu/caffe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ronghanghu/caffe/labels{/name}","releases_url":"https://api.github.com/repos/ronghanghu/caffe/releases{/id}","created_at":"2014-07-03T21:43:59Z","updated_at":"2015-05-18T01:56:04Z","pushed_at":"2015-05-30T03:01:09Z","git_url":"git://github.com/ronghanghu/caffe.git","ssh_url":"git@github.com:ronghanghu/caffe.git","clone_url":"https://github.com/ronghanghu/caffe.git","svn_url":"https://github.com/ronghanghu/caffe","homepage":"http://caffe.berkeleyvision.org/","size":41541,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":7,"default_branch":"master"}},"base":{"label":"BVLC:master","ref":"master","sha":"df58775846f3b4fa43ddf7a50f478a6a1ce6c58e","user":{"login":"BVLC","id":6182163,"avatar_url":"https://avatars.githubusercontent.com/u/6182163?v=3","gravatar_id":"","url":"https://api.github.com/users/BVLC","html_url":"https://github.com/BVLC","followers_url":"https://api.github.com/users/BVLC/followers","following_url":"https://api.github.com/users/BVLC/following{/other_user}","gists_url":"https://api.github.com/users/BVLC/gists{/gist_id}","starred_url":"https://api.github.com/users/BVLC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BVLC/subscriptions","organizations_url":"https://api.github.com/users/BVLC/orgs","repos_url":"https://api.github.com/users/BVLC/repos","events_url":"https://api.github.com/users/BVLC/events{/privacy}","received_events_url":"https://api.github.com/users/BVLC/received_events","type":"Organization","site_admin":false},"repo":{"id":12791642,"name":"caffe","full_name":"BVLC/caffe","owner":{"login":"BVLC","id":6182163,"avatar_url":"https://avatars.githubusercontent.com/u/6182163?v=3","gravatar_id":"","url":"https://api.github.com/users/BVLC","html_url":"https://github.com/BVLC","followers_url":"https://api.github.com/users/BVLC/followers","following_url":"https://api.github.com/users/BVLC/following{/other_user}","gists_url":"https://api.github.com/users/BVLC/gists{/gist_id}","starred_url":"https://api.github.com/users/BVLC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BVLC/subscriptions","organizations_url":"https://api.github.com/users/BVLC/orgs","repos_url":"https://api.github.com/users/BVLC/repos","events_url":"https://api.github.com/users/BVLC/events{/privacy}","received_events_url":"https://api.github.com/users/BVLC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BVLC/caffe","description":"Caffe: a fast open framework for deep learning.","fork":false,"url":"https://api.github.com/repos/BVLC/caffe","forks_url":"https://api.github.com/repos/BVLC/caffe/forks","keys_url":"https://api.github.com/repos/BVLC/caffe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BVLC/caffe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BVLC/caffe/teams","hooks_url":"https://api.github.com/repos/BVLC/caffe/hooks","issue_events_url":"https://api.github.com/repos/BVLC/caffe/issues/events{/number}","events_url":"https://api.github.com/repos/BVLC/caffe/events","assignees_url":"https://api.github.com/repos/BVLC/caffe/assignees{/user}","branches_url":"https://api.github.com/repos/BVLC/caffe/branches{/branch}","tags_url":"https://api.github.com/repos/BVLC/caffe/tags","blobs_url":"https://api.github.com/repos/BVLC/caffe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BVLC/caffe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BVLC/caffe/git/refs{/sha}","trees_url":"https://api.github.com/repos/BVLC/caffe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BVLC/caffe/statuses/{sha}","languages_url":"https://api.github.com/repos/BVLC/caffe/languages","stargazers_url":"https://api.github.com/repos/BVLC/caffe/stargazers","contributors_url":"https://api.github.com/repos/BVLC/caffe/contributors","subscribers_url":"https://api.github.com/repos/BVLC/caffe/subscribers","subscription_url":"https://api.github.com/repos/BVLC/caffe/subscription","commits_url":"https://api.github.com/repos/BVLC/caffe/commits{/sha}","git_commits_url":"https://api.github.com/repos/BVLC/caffe/git/commits{/sha}","comments_url":"https://api.github.com/repos/BVLC/caffe/comments{/number}","issue_comment_url":"https://api.github.com/repos/BVLC/caffe/issues/comments{/number}","contents_url":"https://api.github.com/repos/BVLC/caffe/contents/{+path}","compare_url":"https://api.github.com/repos/BVLC/caffe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BVLC/caffe/merges","archive_url":"https://api.github.com/repos/BVLC/caffe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BVLC/caffe/downloads","issues_url":"https://api.github.com/repos/BVLC/caffe/issues{/number}","pulls_url":"https://api.github.com/repos/BVLC/caffe/pulls{/number}","milestones_url":"https://api.github.com/repos/BVLC/caffe/milestones{/number}","notifications_url":"https://api.github.com/repos/BVLC/caffe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BVLC/caffe/labels{/name}","releases_url":"https://api.github.com/repos/BVLC/caffe/releases{/id}","created_at":"2013-09-12T18:39:48Z","updated_at":"2015-05-30T00:48:04Z","pushed_at":"2015-05-30T03:01:10Z","git_url":"git://github.com/BVLC/caffe.git","ssh_url":"git@github.com:BVLC/caffe.git","clone_url":"https://github.com/BVLC/caffe.git","svn_url":"https://github.com/BVLC/caffe","homepage":"http://caffe.berkeleyvision.org/","size":64258,"stargazers_count":3708,"watchers_count":3708,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2206,"mirror_url":null,"open_issues_count":288,"forks":2206,"open_issues":288,"watchers":3708,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BVLC/caffe/pulls/2527"},"html":{"href":"https://github.com/BVLC/caffe/pull/2527"},"issue":{"href":"https://api.github.com/repos/BVLC/caffe/issues/2527"},"comments":{"href":"https://api.github.com/repos/BVLC/caffe/issues/2527/comments"},"review_comments":{"href":"https://api.github.com/repos/BVLC/caffe/pulls/2527/comments"},"review_comment":{"href":"https://api.github.com/repos/BVLC/caffe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BVLC/caffe/pulls/2527/commits"},"statuses":{"href":"https://api.github.com/repos/BVLC/caffe/statuses/cb3cb25accbc976c4791882854d47ca9cab14e78"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":42,"deletions":32,"changed_files":3}}