Skip to content

Commit bd6f990

Browse files
committed
update some thing
1 parent fb9103e commit bd6f990

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

subs/ai/src/main/java/com/engineer/ai/util/DigitClassifier.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class DigitClassifier(private val context: Context) {
4747
// Read input shape from model file
4848
interpreter?.let { inter ->
4949
val inputShape = inter.getInputTensor(0).shape()
50+
Log.d(TAG,inputShape.toString())
5051
inputImageWidth = inputShape[1]
5152
inputImageHeight = inputShape[2]
5253
modelInputSize = FLOAT_TYPE_SIZE * inputImageWidth * inputImageHeight * PIXEL_SIZE
@@ -72,6 +73,7 @@ class DigitClassifier(private val context: Context) {
7273
// Post-processing: find the digit that has the highest probability
7374
// and return it a human-readable string.
7475
val result = output[0]
76+
Log.d(TAG,"result = $result")
7577
val maxIndex = result.indices.maxBy { result[it] }
7678
val resultString = "Prediction Result: %d\nConfidence: %2f".format(maxIndex, result[maxIndex])
7779

subs/ai/src/main/java/com/engineer/ai/util/TensorFlowLiteHelper.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ object TensorFlowLiteHelper {
2727
Log.d(TAG, "ver ${TensorFlowLite.runtimeVersion(InterpreterApi.Options.TfLiteRuntime.FROM_SYSTEM_ONLY)}")
2828
cb(true)
2929
}.addOnFailureListener {
30-
Log.d(TAG, "Initialized TFLite fail.")
30+
Log.d(TAG, "Initialized TFLite fail")
3131
cb(false)
32+
Log.e(TAG, "error ", it)
3233
}
3334
}
3435

0 commit comments

Comments
 (0)