Last active
December 3, 2019 15:00
-
-
Save neonankiti/153b5a94a14dc87ad024f63f52de278c to your computer and use it in GitHub Desktop.
Pose Estimation with TensorFlow Lite in Android Sample
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
@Throws(IOException::class) | |
private fun loadModelFile(activity: Activity): MappedByteBuffer { | |
// modelPath would be something like "image_classifier.tflite" | |
val fileDescriptor = activity.assets.openFd(modelPath) | |
val inputStream = FileInputStream(fileDescriptor.fileDescriptor) | |
val fileChannel = inputStream.channel | |
val startOffset = fileDescriptor.startOffset | |
val declaredLength = fileDescriptor.declaredLength | |
return fileChannel.map(MapMode.READ_ONLY, startOffset, declaredLength) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is copy of https://github.com/edvardHua/PoseEstimationForMobile/ projects.
This software includes the work that is distributed in the Apache License 2.0.