Comments (6)
import 'package:flutter/painting.dart';
And then change the 'new fileimage'function to
new FileImage(image)
.resolve(new ImageConfiguration())
.addListener( ((ImageInfo info, bool synchronousCall) {
setState(() {
_imageHeight = info.image.height.toDouble();
_imageWidth = info.image.width.toDouble();
});
}) as ImageStreamListener);
seems to solve this one.
from flutter_tflite.
Yes. Looks like they changed addListener
interface in painting library.
flutter/flutter@592f81e#diff-c40603317cbbb567a0ac6c32803d6788R292
Casting the type to ImageStreamListener
as @tnup suggested should be the solution.
Thanks,
Qian
from flutter_tflite.
I am receiving the following error.
Exception has occurred.
_CastError (type '(ImageInfo, bool) => Null' is not a subtype of type 'ImageStreamListener' in type cast)
Launching lib/main.dart on Pixel 2 XL in debug mode...
Built build/app/outputs/apk/debug/app-debug.apk.
I/tflite ( 7567): Initialized TensorFlow Lite runtime.
I/flutter ( 7567): success
W/System ( 7567): A resource failed to call close.
V/time ( 7567): Inference took 233
I/flutter ( 7567): [{score: 0.9141436219215393, keypoints: {0: {score: 0.9366106390953064, part: nose, x: 0.9072170257568359, y: 0.7681019902229309}, 1: {score: 0.8853325247764587, part: leftEye, x: 0.9083921909332275, y: 0.7660269737243652}, 2: {score: 0.895061194896698, part: rightEye, x: 0.9051240086555481, y: 0.7632570266723633}, 3: {score: 0.6452447772026062, part: leftEar, x: 0.9123005270957947, y: 0.7663577198982239}, 4: {score: 0.5991162061691284, part: rightEar, x: 0.9066846966743469, y: 0.7621657252311707}, 5: {score: 0.9771823287010193, part: leftShoulder, x: 0.905788004398346, y: 0.7937831878662109}, 6: {score: 0.9885516166687012, part: rightShoulder, x: 0.901046633720398, y: 0.7925692796707153}, 7: {score: 0.9520376920700073, part: leftElbow, x: 0.9105158448219299, y: 0.8237140774726868}, 8: {score: 0.9721059203147888, part: rightElbow, x: 0.904983639717102, y: 0.8216578364372253}, 9: {score: 0.9290830492973328, part: leftWrist, x: 0.9192070960998535, y: 0.8451672196388245}, 10: {score: 0.9260290265083313, part: r
from flutter_tflite.
try this @PrinceP
new FileImage(image)
.resolve(new ImageConfiguration())
.addListener( new ImageStreamListener((ImageInfo info, bool synchronousCall) {
setState(() {
_imageHeight = info.image.height.toDouble();
_imageWidth = info.image.width.toDouble();
});
}) as ImageStreamListener);
setState(() {
_image = image;
_busy = false;
});
}
double cast, but works.
from flutter_tflite.
@tnup Couldn't understand but this works. Thanks
from flutter_tflite.
I'm archiving this thread. Feel free to reopen if you have further questions.
Thanks,
Qian
from flutter_tflite.
Related Issues (20)
- FAILURE: Build failed with an exception.What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.
- Async Task is Deprecated
- Build file '/Users/macbookpro/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.1.2/android/build.gradle' line: 24 HOT 7
- Last dart version is not supported
- The plugin `tflite` uses a deprecated version of the Android embedding. HOT 2
- Is this package abandoned? HOT 1
- PLEASE UPDATE THIS VERSION OF TFLITE huhuhu HOT 1
- [!] No podspec found for `flutter_tflite` in `.symlinks/plugins/flutter_tflite/ios` HOT 13
- Deprecated version of the Android embedding HOT 1
- app crashed while deploying tflite loaded model and Android V2 Embedding error HOT 1
- Do not support version greater than 3
- Can I build desktop app by this package?
- E/AndroidRuntime( 4563): Caused by: java.lang.IllegalArgumentException: Cannot copy from a TensorFlowLite tensor (StatefulPartitionedCall:0) with shape [1, 10647, 6] to a Java object with shape [1, 13, 13, 30]. HOT 1
- runModelOnImage returns null HOT 1
- I have a issue in runSegmentationOnImage
- The plugin `tflite` uses a deprecated version of the Android embedding. HOT 1
- The plugin `tflite` uses a deprecated version of the Android embedding. HOT 1
- got this error when running flutter project HOT 3
- Unhandled Exception: PlatformException(Failed to run model, Interpreter busy, java.lang.RuntimeException: Interpreter busy HOT 3
- Can anyone help giving this code in Flutter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_tflite.