使用MLKIT条形码扫描仪的错误
我正在使用Firebase的条形码扫描仪,但是我总是会遇到三个错误,我不知道它们是否可以影响我的应用程序
Failed to open file '/data/data/com.example.veggystock/code_cache/.overlay/base.apk/assets/mlkit_barcode_models/barcode_ssd_mobilenet_v1_dmp25_quant.tflite': No such file or directory
Failed to open file '/data/data/com.example.veggystock/code_cache/.overlay/base.apk/assets/mlkit_barcode_models/oned_auto_regressor_mobile.tflite': No such file or directory
Failed to open file '/data/data/com.example.veggystock/code_cache/.overlay/base.apk/assets/mlkit_barcode_models/oned_feature_extractor_mobile.tflite': No such file or directory
我的代码以使用UPC处理图像是这样
scanner.process(image)
.addOnSuccessListener { barcodes ->
for (barcode in barcodes) {
val rawValue = barcode.rawValue.toString()
Log.d("RAWVALUE ->>>", rawValue)
CoroutineScope(Dispatchers.IO).launch {
val apiCall = getRetrofit(urlBaseUpc).create(ApiService::class.java)
.foodDatabase("parser?app_id=$appIdDatabase&app_key=$appKeyDatabase&upc=$rawValue")
//&health=vegetarian
if (apiCall.isSuccessful) {
apiCallBody = apiCall.body()!!
if (apiCallBody.listHints.isNotEmpty()) {
apiCall2 =
getRetrofit(urlBaseNutrition).create(ApiService::class.java)
.foodAnalysis("nutrition-data?app_id=$appIdNutrition&app_key=$appKeyNutrition&ingr=${apiCallBody.listHints.first().food.id}")
//&nutrition-type=cooking
runOnUiThread {
if (apiCall2.isSuccessful) {
apiCall2Body = apiCall2.body()!!
if (apiCall2Body.healthLabels.contains("VEGAN")) {
alertBuilder(
R.style.alertDialogPositive,
"${apiCallBody.listHints.first().food.label} is Vegan"
)
} else {
alertBuilder(
R.style.alertDialogNegative,
"${apiCallBody.listHints.first().food.label} is not Vegan"
)
}
} else {
Log.e("PROBLEM ->>", "API CALL NOT SUCCESFUL")
}
}
} else {
alertNotFound()
}
}
}
}
}
.addOnFailureListener {
Log.e("PROBLEM ->>>>>>", "BARCODE NOT RECOGNIZED")
}
I am using the barcode scanner from firebase which is working well, however I always get three errors and I don't know if at some moment they could affect my app
Failed to open file '/data/data/com.example.veggystock/code_cache/.overlay/base.apk/assets/mlkit_barcode_models/barcode_ssd_mobilenet_v1_dmp25_quant.tflite': No such file or directory
Failed to open file '/data/data/com.example.veggystock/code_cache/.overlay/base.apk/assets/mlkit_barcode_models/oned_auto_regressor_mobile.tflite': No such file or directory
Failed to open file '/data/data/com.example.veggystock/code_cache/.overlay/base.apk/assets/mlkit_barcode_models/oned_feature_extractor_mobile.tflite': No such file or directory
My code to process the image with the UPC is this
scanner.process(image)
.addOnSuccessListener { barcodes ->
for (barcode in barcodes) {
val rawValue = barcode.rawValue.toString()
Log.d("RAWVALUE ->>>", rawValue)
CoroutineScope(Dispatchers.IO).launch {
val apiCall = getRetrofit(urlBaseUpc).create(ApiService::class.java)
.foodDatabase("parser?app_id=$appIdDatabase&app_key=$appKeyDatabase&upc=$rawValue")
//&health=vegetarian
if (apiCall.isSuccessful) {
apiCallBody = apiCall.body()!!
if (apiCallBody.listHints.isNotEmpty()) {
apiCall2 =
getRetrofit(urlBaseNutrition).create(ApiService::class.java)
.foodAnalysis("nutrition-data?app_id=$appIdNutrition&app_key=$appKeyNutrition&ingr=${apiCallBody.listHints.first().food.id}")
//&nutrition-type=cooking
runOnUiThread {
if (apiCall2.isSuccessful) {
apiCall2Body = apiCall2.body()!!
if (apiCall2Body.healthLabels.contains("VEGAN")) {
alertBuilder(
R.style.alertDialogPositive,
"${apiCallBody.listHints.first().food.label} is Vegan"
)
} else {
alertBuilder(
R.style.alertDialogNegative,
"${apiCallBody.listHints.first().food.label} is not Vegan"
)
}
} else {
Log.e("PROBLEM ->>", "API CALL NOT SUCCESFUL")
}
}
} else {
alertNotFound()
}
}
}
}
}
.addOnFailureListener {
Log.e("PROBLEM ->>>>>>", "BARCODE NOT RECOGNIZED")
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些
资产/mlkit_barcode_models/*。tflite
tensorflow Lite模型缺少。如果它仍然检测到条形码,则可能是由于
Playser-Services-Mlkit-Barcode-Scanning
。a)用于将模型与您的应用程序捆绑(较大的软件包):
b)用于使用Google Play服务中的模型(下载点播):
扫描条形码在Android上。
These
assets/mlkit_barcode_models/*.tflite
TensorFlow Lite models are missing.If it still detects barcode, this may be due to
play-services-mlkit-barcode-scanning
.a) For bundling the models with your app (larger package):
b) For using the models from Google Play Services (download on demand):
Source: Scan Barcodes with ML Kit on Android.