Created
July 13, 2022 08:01
-
-
Save muhwyndhamhp/10210299f86cef1e9030f483dfed7cf3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
val interpreterOptions = Interpreter.Options().apply { | |
setNumThreads(4) | |
} | |
val interpreter = Interpreter(FileUtil.loadMappedFile(context, "model.tflite"), interpreterOptions) | |
private fun runFaceNet(inputs: Any): Array<FloatArray> { | |
val faceNetModelOutputs: MutableMap<Int, Any> = HashMap() | |
faceNetModelOutputs[0] = Array(1) { FloatArray(embeddingDim) } | |
interpreter.runForMultipleInputsOutputs(arrayOf(inputs), faceNetModelOutputs) | |
return faceNetModelOutputs[0] as Array<FloatArray> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment