识别相似度阈值设为99%,未识别到物品增加弹窗
This commit is contained in:
@@ -230,6 +230,14 @@ abstract class GoodsListActivity : ComponentActivity() {
|
|||||||
Timber.d("${this.javaClass.simpleName}-searchFood-裁剪bitmap保存文件路径:${file?.absolutePath}")
|
Timber.d("${this.javaClass.simpleName}-searchFood-裁剪bitmap保存文件路径:${file?.absolutePath}")
|
||||||
val foodNameList = FoodModule.queryFood(newBmp)
|
val foodNameList = FoodModule.queryFood(newBmp)
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
if (foodNameList.isEmpty()) {
|
||||||
|
handleGoodsResult(
|
||||||
|
goodsList = mutableListOf(),
|
||||||
|
file = file,
|
||||||
|
name = null
|
||||||
|
)
|
||||||
|
return@runOnUiThread
|
||||||
|
}
|
||||||
viewModel.recognizeGoodsList(foodNameList) { goodsList ->
|
viewModel.recognizeGoodsList(foodNameList) { goodsList ->
|
||||||
handleGoodsResult(
|
handleGoodsResult(
|
||||||
goodsList = if (goodsList.size == foodNameList.size) goodsList else mutableListOf(),
|
goodsList = if (goodsList.size == foodNameList.size) goodsList else mutableListOf(),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import com.sw.inbound.utils.ext.hideKeyboard
|
|||||||
abstract class BaseDialog(
|
abstract class BaseDialog(
|
||||||
context: Context,
|
context: Context,
|
||||||
var defWidth: Int = 1500.dp,
|
var defWidth: Int = 1500.dp,
|
||||||
var defHeight: Int = 800.dp
|
var defHeight: Int = 900.dp
|
||||||
) : Dialog(context, R.style.DialogTheme) {
|
) : Dialog(context, R.style.DialogTheme) {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ object FoodModule {
|
|||||||
nameScoreList.add(IdNameScore(id = it.id, name = box.get(it.id).name?:"", score = it.score))
|
nameScoreList.add(IdNameScore(id = it.id, name = box.get(it.id).name?:"", score = it.score))
|
||||||
}
|
}
|
||||||
Timber.tag("FoodModule").d("queryFood数据:${nameScoreList.toJsonString()}")
|
Timber.tag("FoodModule").d("queryFood数据:${nameScoreList.toJsonString()}")
|
||||||
idScoreList.filter { it.score < 0.2 }.forEach {
|
idScoreList.filter { it.score < 0.01 }.forEach {
|
||||||
val food = box.get(it.id)
|
val food = box.get(it.id)
|
||||||
//FoodQueryResult(id = it.id, name = food.name, foodIdx = food.foodIdx, score = it.score)
|
//FoodQueryResult(id = it.id, name = food.name, foodIdx = food.foodIdx, score = it.score)
|
||||||
food.name?.let { key ->
|
food.name?.let { key ->
|
||||||
|
|||||||
Reference in New Issue
Block a user