Created
December 4, 2019 00:16
-
-
Save neonankiti/daeb7b24dd9c21164bc9be00ebe5d0ae to your computer and use it in GitHub Desktop.
Pose Estimation with TensorFlow Lite in Android Sample
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
/** Writes Image data into a `ByteBuffer`. */ | |
private fun convertBitmapToByteBuffer(bitmap: Bitmap) { | |
imgData!!.rewind() | |
// intValues are input image size memory like IntArray(bitmap.width * bitmap.height) | |
bitmap.getPixels(intValues, 0, bitmap.width, 0, 0, bitmap.width, bitmap.height) | |
// Convert the image to floating point. | |
var pixel = 0 | |
for (i in 0 until imageSizeX) { | |
for (j in 0 until imageSizeY) { | |
val v = intValues[pixel++] | |
addPixelValue(v) | |
} | |
} | |
} |
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.