diff options
author | Andrew Harp <andrewharp@google.com> | 2017-08-03 17:50:45 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-08-03 17:54:17 -0700 |
commit | 268bb07e3d0330bb781216036ff02586a84f7111 (patch) | |
tree | 1c5b250f74a81d4e5e1823099cd295e6d42a1301 /tensorflow/examples/android | |
parent | 51e8bbd091c4c0425a31ed60122032d6249d31a8 (diff) |
Android multibox detector: fix int to float RGB conversion to the correct order
PiperOrigin-RevId: 164209391
Diffstat (limited to 'tensorflow/examples/android')
-rw-r--r-- | tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java b/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java index 1dcf9f55ef..b4a231ff17 100644 --- a/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java +++ b/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java @@ -210,9 +210,9 @@ public class TensorFlowMultiBoxDetector implements Classifier { bitmap.getPixels(intValues, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight()); for (int i = 0; i < intValues.length; ++i) { - floatValues[i * 3 + 0] = ((intValues[i] & 0xFF) - imageMean) / imageStd; + floatValues[i * 3 + 0] = (((intValues[i] >> 16) & 0xFF) - imageMean) / imageStd; floatValues[i * 3 + 1] = (((intValues[i] >> 8) & 0xFF) - imageMean) / imageStd; - floatValues[i * 3 + 2] = (((intValues[i] >> 16) & 0xFF) - imageMean) / imageStd; + floatValues[i * 3 + 2] = ((intValues[i] & 0xFF) - imageMean) / imageStd; } Trace.endSection(); // preprocessBitmap |