Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.