Created
July 27, 2020 13:43
-
-
Save ksdkamesh99/c746dbedc5636029f43e69fe92e34f5b 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
private MappedByteBuffer loadModelFile() throws IOException { | |
AssetFileDescriptor fileDescriptor=this.getAssets().openFd("degree.tflite"); | |
FileInputStream inputStream=new FileInputStream(fileDescriptor.getFileDescriptor()); | |
FileChannel fileChannel=inputStream.getChannel(); | |
long startOffset=fileDescriptor.getStartOffset(); | |
long declareLength=fileDescriptor.getDeclaredLength(); | |
return fileChannel.map(FileChannel.MapMode.READ_ONLY,startOffset,declareLength); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment