优化
This commit is contained in:
@@ -16,7 +16,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?) {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class GoodsRecognizeDialog(
|
|||||||
binding.btnAgainRecognize.setOnClickListener {
|
binding.btnAgainRecognize.setOnClickListener {
|
||||||
//dismiss()
|
//dismiss()
|
||||||
activity?.againRecognizeFood { goodsList ->
|
activity?.againRecognizeFood { goodsList ->
|
||||||
binding.rvRecognize.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
//binding.rvRecognize.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
||||||
list.clear()
|
list.clear()
|
||||||
list.addAll(goodsList)
|
list.addAll(goodsList)
|
||||||
recognizeAdapter.notifyDataSetChanged()
|
recognizeAdapter.notifyDataSetChanged()
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ object FoodModule {
|
|||||||
val floatArray = bitmap2FloatArray(bitmap)
|
val floatArray = bitmap2FloatArray(bitmap)
|
||||||
// return emptyList()
|
// return emptyList()
|
||||||
val nameScoreList = queryFoodNameScore(floatArray, queryCount)
|
val nameScoreList = queryFoodNameScore(floatArray, queryCount)
|
||||||
|
if (nameScoreList.isEmpty()) {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
val maxScoreList = nameScoreList
|
val maxScoreList = nameScoreList
|
||||||
.filter { it.score < 0.20 }
|
.filter { it.score < 0.20 }
|
||||||
.groupBy { it.name }
|
.groupBy { it.name }
|
||||||
|
|||||||
Reference in New Issue
Block a user