Created
November 24, 2019 04:30
-
-
Save Lavanyagaur22/25b07b97789fa471521de862b611e919 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 mediaImage = image?.image | |
val imageRotation = ImageRotation.getFromValue(rotationDegrees) | |
val visionImage = FritzVisionImage.fromMediaImage(mediaImage, imageRotation) | |
val labelResult = predictor?.predict(visionImage) | |
runOnUiThread { | |
labelResult?.resultString?.let { | |
val sname = it.split(":") | |
Log.e(TAG, it) | |
Log.e(TAG, sname[0]) | |
tv_name.text = sname[0] | |
} ?: kotlin.run { | |
tv_name.visibility = TextView.INVISIBLE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment