deploy tflite model on android code example
Example: deploy tflite model on android
fun loadModelFile(path: String): MappedByteBuffer { val fileDescriptor = assets.openFd(path) val inputStream = FileInputStream(fileDescriptor.fileDescriptor) val fileChannel = inputStream.channel val startOffset = fileDescriptor.startOffset val declaredLength = fileDescriptor.declaredLength return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength)}