Created
June 26, 2019 11:16
-
-
Save frogermcs/3ea71a68d11afa1f61fbebca9ab3a829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void runInferenceOnQuantizedModel(ByteBuffer byteBufferToClassify) { | |
byte[][] result = new byte[1][labels.size()]; | |
interpreter.run(byteBufferToClassify, result); | |
float[][] resultFloats = new float[1][labels.size()]; | |
byte[] bytes = result[0]; | |
for (int i = 0; i < bytes.length; i++) { | |
float resultF = (bytes[i] & 0xff) / 255.f; | |
resultFloats[0][i] = resultF; | |
} | |
classificationListener.onClassifiedFrame(getSortedResult(resultFloats)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment