File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
subs/ai/src/main/java/com/engineer/ai/util Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff 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\n Confidence: %2f" .format(maxIndex, result[maxIndex])
7779
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments