【发布时间】:2019-08-25 01:53:12
【问题描述】:
我正在尝试通过相机使用 ML-Kit 图像标签来检测手中的物品。例如,如果我向它展示苏打水,它会拾起手、脸、背景等物体……我不感兴趣的东西,然后即使在 0.25 分钟后也找不到手中的物体使用云视觉的准确性。
有没有办法限制视觉寻找的内容或其他提高准确性的方法?
PS:如果这个任务有更好的东西,我也愿意切换 API。
//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()
}
}
能够高精度检测手中的物品。
【问题讨论】:
标签: android kotlin firebase-mlkit