{"action":"created","issue":{"url":"https://api.github.com/repos/KaimingHe/deep-residual-networks/issues/5","repository_url":"https://api.github.com/repos/KaimingHe/deep-residual-networks","labels_url":"https://api.github.com/repos/KaimingHe/deep-residual-networks/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/KaimingHe/deep-residual-networks/issues/5/comments","events_url":"https://api.github.com/repos/KaimingHe/deep-residual-networks/issues/5/events","html_url":"https://github.com/KaimingHe/deep-residual-networks/issues/5","id":133053794,"number":5,"title":"preprocessing?","user":{"login":"ry","id":80,"avatar_url":"https://avatars.githubusercontent.com/u/80?v=3","gravatar_id":"","url":"https://api.github.com/users/ry","html_url":"https://github.com/ry","followers_url":"https://api.github.com/users/ry/followers","following_url":"https://api.github.com/users/ry/following{/other_user}","gists_url":"https://api.github.com/users/ry/gists{/gist_id}","starred_url":"https://api.github.com/users/ry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ry/subscriptions","organizations_url":"https://api.github.com/users/ry/orgs","repos_url":"https://api.github.com/users/ry/repos","events_url":"https://api.github.com/users/ry/events{/privacy}","received_events_url":"https://api.github.com/users/ry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-11T18:39:40Z","updated_at":"2016-02-12T05:43:17Z","closed_at":null,"body":"Hi @KaimingHe ,\r\nI'm wondering about the exact preprocessing involved. The paper just says you subtract the test set mean? Do you switch RGB to BGR like in VGG nets? I assume the input is [0, 255]? Do you use the same means as VGG? \r\n\r\nExperimentation seems to indicate the same preprocessing as used in VGG works?\r\n\r\n```python\r\ndef preprocess(img):\r\n    VGG_MEAN = [103.939, 116.779, 123.68]\r\n    out = np.copy(img) * 255\r\n    out = out[:, :, [2,1,0]] # swap channel from RGB to BGR\r\n    out[:,:,0] -= VGG_MEAN[0]\r\n    out[:,:,1] -= VGG_MEAN[1]\r\n    out[:,:,2] -= VGG_MEAN[2]\r\n    return out\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/KaimingHe/deep-residual-networks/issues/comments/183187647","html_url":"https://github.com/KaimingHe/deep-residual-networks/issues/5#issuecomment-183187647","issue_url":"https://api.github.com/repos/KaimingHe/deep-residual-networks/issues/5","id":183187647,"user":{"login":"KaimingHe","id":11435359,"avatar_url":"https://avatars.githubusercontent.com/u/11435359?v=3","gravatar_id":"","url":"https://api.github.com/users/KaimingHe","html_url":"https://github.com/KaimingHe","followers_url":"https://api.github.com/users/KaimingHe/followers","following_url":"https://api.github.com/users/KaimingHe/following{/other_user}","gists_url":"https://api.github.com/users/KaimingHe/gists{/gist_id}","starred_url":"https://api.github.com/users/KaimingHe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaimingHe/subscriptions","organizations_url":"https://api.github.com/users/KaimingHe/orgs","repos_url":"https://api.github.com/users/KaimingHe/repos","events_url":"https://api.github.com/users/KaimingHe/events{/privacy}","received_events_url":"https://api.github.com/users/KaimingHe/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T05:43:17Z","updated_at":"2016-02-12T05:43:17Z","body":"Hi @ry,\r\nThe order is BGR. The mean is a per-pixel mean image (224x224x3) in the download links, named as \"ResNet_mean.binaryproto\" in caffe's format. For a 3-channel mean you could average along the spatial dimensions from this per-pixel mean image.  "}}