Skip to content

Instantly share code, notes, and snippets.

@yektasarioglu
Last active November 30, 2020 11:34
Show Gist options
  • Save yektasarioglu/663b47417bc30cafd5accea63c03f02b to your computer and use it in GitHub Desktop.
Save yektasarioglu/663b47417bc30cafd5accea63c03f02b to your computer and use it in GitHub Desktop.
Getting MLFrame
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initializeAnalyzer()
binding?.selectImageButton?.setOnClickListener { askImageFromUser() }
binding?.analyzeButton?.setOnClickListener {
analyze(getMLFrame(selectedImageBitmap ?: return@setOnClickListener))
}
}
private fun getMLFrame(bitmap: Bitmap) : MLFrame {
// Create an MLFrame object using the bitmap, which is the image data in bitmap format.
return MLFrame.fromBitmap(bitmap)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment