替换菜品识别模型,暂时取消相似的判断,查询全部数据测试新模型效果,暂时取消查询前后数据量不一致的判断避免查不出数据

This commit is contained in:
mazengfei
2026-02-11 18:05:40 +08:00
parent 655e9cd56e
commit f562abc12f
9 changed files with 274 additions and 125 deletions
@@ -607,6 +607,7 @@ class FoodCollectionActivity : ComponentActivity() {
tip
mDialogWaiting = CustomDialog(this, view, R.style.MyDialog)
mDialogWaiting!!.show()
mDialogWaiting!!.setCanceledOnTouchOutside(true)
mDialogWaiting!!.setCancelable(true)
}
}
@@ -628,6 +629,7 @@ class FoodCollectionActivity : ComponentActivity() {
val view = View.inflate(this, R.layout.dialog_waiting, null)
mDialogWaiting = CustomDialog(this, view, R.style.MyDialog)
mDialogWaiting!!.show()
mDialogWaiting!!.setCanceledOnTouchOutside(true)
mDialogWaiting!!.setCancelable(true)
}
val contentView = mDialogWaiting?.findViewById<ViewGroup>(android.R.id.content)
@@ -377,7 +377,8 @@ abstract class GoodsListActivity : ComponentActivity() {
if (newBmp.isRecycled.not()) {
newBmp.recycle()
}
val count = foodList.count { it.score < 0.15 }
// val count = foodList.count { it.score < 0.15 }
val count = foodList.size
if (count == 0) {
//未识别到满足相似度>=0.85的,显示识别率最高的
var tempList = foodList.filter { it.name.contains("黑袋子").not() }
@@ -429,7 +430,9 @@ abstract class GoodsListActivity : ComponentActivity() {
return@runOnUiThread
}
handleGoodsResult(
goodsList = if (goodsList.size == foodList.size) goodsList else mutableListOf(),
// TODO: 暂时取消不一致判断,显示查询到的菜品
// goodsList = if (goodsList.size == foodList.size) goodsList else mutableListOf(),
goodsList = goodsList,
// file = null,
// name = foodList.joinToString(",")
)