Created
July 16, 2019 13:23
-
-
Save obeshor/fd404ca8345380811df3e4babbb3f9e4 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
fun recognizeImage(bitmap: Bitmap): List<Classifier.Recognition> { | |
val scaledBitmap = Bitmap.createScaledBitmap(bitmap, INPUT_SIZE, INPUT_SIZE, false) | |
val byteBuffer = convertBitmapToByteBuffer(scaledBitmap) | |
val result = Array(1) { FloatArray(LABEL_LIST.size) } | |
INTERPRETER.run(byteBuffer, result) | |
return getSortedResult(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment