Skip to content

Instantly share code, notes, and snippets.

@Lavanyagaur22
Created November 24, 2019 04:30
Show Gist options
  • Save Lavanyagaur22/25b07b97789fa471521de862b611e919 to your computer and use it in GitHub Desktop.
Save Lavanyagaur22/25b07b97789fa471521de862b611e919 to your computer and use it in GitHub Desktop.
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