mirror of
https://github.com/wassname/keras-js.git
synced 2026-09-12 12:33:40 +08:00
for ResNet50, apply imagenet mean pixel on BGR instead of RGB
see https://github.com/fchollet/keras/pull/4027
This commit is contained in:
@@ -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
@@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user