I'm trying to detect items held in a hand using ML-Kit image labeling through a camera. If for example, I show it a soda can it picks up objects such as the hand, face, background etc... Things I'm not interested in and then doesn't find the object in the hand even at a .25 min accuracy using cloud vision.
Is there a way to limit what the vision looks for or another way to increase accuracy?
PS: I am also willing to switch APIs if there is something better for this task.
//This is mostly from a google tutorial
private fun runCloudImageLabeling(bitmap: Bitmap) {
//Create a FirebaseVisionImage
val image = FirebaseVisionImage.fromBitmap(bitmap)
val detector = FirebaseVision.getInstance().visionCloudLabelDetector
//Use the detector to detect the labels inside the image
detector.detectInImage(image)
.addOnSuccessListener {
// Task completed successfully
progressBar.visibility = View.GONE
itemAdapter.setList(it)
sheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED)
}
.addOnFailureListener {
// Task failed with an exception
progressBar.visibility = View.GONE
Toast.makeText(baseContext, "Sorry, something went wrong!", Toast.LENGTH_SHORT).show()
}
}
The ability to detect what's in the hand at high accuracy.