From 268bb07e3d0330bb781216036ff02586a84f7111 Mon Sep 17 00:00:00 2001 From: Andrew Harp Date: Thu, 3 Aug 2017 17:50:45 -0700 Subject: Android multibox detector: fix int to float RGB conversion to the correct order PiperOrigin-RevId: 164209391 --- .../android/src/org/tensorflow/demo/TensorFlowMultiBoxDetector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tensorflow/examples/android') 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 -- cgit v1.2.3