learning
learning copied to clipboard
DigitalInkRecognition returns null scores
Hi,
First off thanks for the libraries, they're pretty awesome!
I was playing around with the digital ink recognition part of the example app and noticed that the scores of every RecognitionCandidate
returned was null.
Reproduction steps
- Add the following printout statement on line 80 of
digital_ink_recognition.dart
:
for (final candidate in state.data) {
debugPrint(
'$LearningDigitalInkRecognition: _startRecognition : text=${candidate.text} : score=${candidate.score}');
}
- Launch the example app
- On the main screen select "Digital Ink Recognition"
- Draw a "W" on the canvas
- Tap the "Start Recognition" button
Expected output
- A list of
RecognitionCandidate
, each with member variablestext
(String) andscore
(double?) set to non-null values when appropriate
Actual output
- A list of
RecognitionCandidate
which all have the variabletext
populated with a meaningful value butscore
is null - As the log below shows, the first candidate at least should have a score as we can see it being printed out in both
tf_recognizer.cc
andhelper.cc
Execution Log
I/flutter ( 1994): main
I/MddModelManager( 1994): isModelDownloadedAndValid()
I/MddModelManager( 1994): isModelDownloadedAndValid()
I/native ( 1994): tf_recognizer.cc:192 inkhash: 59ce57784a4f74a8
I/native ( 1994): tf_recognizer.cc:219 LabeledInkCurveProcessor returned 4 timesteps for 59ce57784a4f74a8.
I/native ( 1994): tf_recognizer.cc:293 best result: 'W' score: 52.4192
I/native ( 1994): tf_recognizer.cc:345 1 request 17.71% 1.3ms overall 24.61% 0.01s LabeledInkProcessor
I/native ( 1994): 2 request 55.93% 4.2ms overall 51.79% 0.02s RunTfLiteModelRunner
I/native ( 1994): 3 request 26.36% 2.0ms overall 23.60% 0.01s Decoder
I/native ( 1994): request 7.5ms overall 0.04s Total
I/native ( 1994):
I/native ( 1994): helper.cc:160 Recognition result: W with score: 52.4192
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=W : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=w : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=Wi : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=wi : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=W : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=WW : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=w : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=WN : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=WV : score=null
I/flutter ( 1994): LearningDigitalInkRecognition: _startRecognition : text=Wr : score=null
Flutter Doctor
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.4 20F71 darwin-arm, locale en-US)
• Flutter version 2.5.0 at /Users/charles/NonSystemic/Code/flutter2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (6 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/charles/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.60.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.26.0
[✓] Connected device (1 available)
• Pixel 3a (mobile) • 95SAY0VKZU • android-arm64 • Android 11 (API 30)
• No issues found!