Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DigitalInkRecognition returns null scores #8

Open
LeFrenchTouch opened this issue Sep 14, 2021 · 0 comments
Open

DigitalInkRecognition returns null scores #8

LeFrenchTouch opened this issue Sep 14, 2021 · 0 comments

Comments

@LeFrenchTouch
Copy link

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

  1. 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}');
}
  1. Launch the example app
  2. On the main screen select "Digital Ink Recognition"
  3. Draw a "W" on the canvas
  4. Tap the "Start Recognition" button

Expected output

  • A list of RecognitionCandidate, each with member variables text (String) and score (double?) set to non-null values when appropriate

Actual output

  • A list of RecognitionCandidate which all have the variable text populated with a meaningful value but score 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 and helper.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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant