for ResNet50, apply imagenet mean pixel on BGR instead of RGB

see https://github.com/fchollet/keras/pull/4027
This commit is contained in:
Leon Chen
2016-10-11 17:52:00 -04:00
parent 5fa9f9e486
commit 79b25b9e6a
3 changed files with 4203 additions and 3 deletions
+2 -2
View File
@@ -185,9 +185,9 @@ export const ResNet50 = Vue.extend({
// see https://github.com/fchollet/keras/blob/master/keras/applications/imagenet_utils.py
let dataTensor = ndarray(new Float32Array(data), [width, height, 4])
let dataProcessedTensor = ndarray(new Float32Array(width * height * 3), [width, height, 3])
ops.subseq(dataTensor.pick(null, null, 0), 103.939)
ops.subseq(dataTensor.pick(null, null, 2), 103.939)
ops.subseq(dataTensor.pick(null, null, 1), 116.779)
ops.subseq(dataTensor.pick(null, null, 2), 123.68)
ops.subseq(dataTensor.pick(null, null, 0), 123.68)
ops.assign(dataProcessedTensor.pick(null, null, 0), dataTensor.pick(null, null, 2))
ops.assign(dataProcessedTensor.pick(null, null, 1), dataTensor.pick(null, null, 1))
ops.assign(dataProcessedTensor.pick(null, null, 2), dataTensor.pick(null, null, 0))
+1 -1
View File
@@ -61,7 +61,7 @@
"postcss-loader": "^0.13.0",
"precss": "^1.4.0",
"raw-loader": "^0.5.1",
"standard": "^8.3.0",
"standard": "^8.4.0",
"style-loader": "^0.13.1",
"webpack": "^2.1.0-beta.25"
},
+4200
View File
File diff suppressed because it is too large Load Diff