-
Notifications
You must be signed in to change notification settings - Fork 144
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
please add image classification example #10
Comments
Hello @Emon526 This PR is not for a merge. It is rather to share a working example. So you can just download it from my fork. It still has a lot of legacy code and I'd like to refactor it in the future, but for now. |
thanks a lot @Alexi-Zemcov but the author of tflite_flutter_helper mentioned not to use the package because the package is discontinued.i am looking for a alternative solution |
Hello @Emon526 , |
Got it. So this is definitely an example that I'd like to have together once everything is up to date, but in the meantime the logic should be close-ish to this Android sample. As for the helper, the plan is to put something together that does exactly what that did, but with a richer feature set, via MediaPipe. By all means if you need a solution right now then the helper is still a solid option that'll get the job done with a bit of work into it (what Alexi did as an example) :) |
By the way, I faced into the problem described in this comment. My .tflite model required grayscale image data in one channel. But in fact, as the Does anyone have any ideas what to do with this? |
Nice to meet you again, and my model also accepts the same as yours. My solution is export the lumi as a brand new tensor. https://github.com/JSYRD/krccsnet/blob/master/lib/krccsnet_encoder.dart In the function |
Also while this is in development, ML Kit might be a solid answer for you (even long term) - https://pub.dev/packages/google_mlkit_image_labeling |
Unfortunately it didn't work for my model. Now it trow StateError even earlier on the Update: I was wrong. @JSYRD, your example perfectly prepares the image to work with my model. But in my case, I had to replace |
Thank you very much! So now I will try this package, may be it will be easier way for me. |
In this PR #49 I added an example of image classification using mobilenet. You can also check it in my fork https://github.com/luiscib3r/flutter-tflite/tree/develop/example/image_classification_mobilenet. Any questions, suggestions, or bug reports are welcome. |
@luiscib3r thank you for the help.i think there is something wrong with my model .can you please provide me some documentation so that i can build my model |
@Emon526 If you can send me any error messages you are getting while loading the model I might have a better idea. One tip that I follow with all models is to do getTensorInputs and getTensorOutputs and print their value, so I can clearly see the shape of the tensors and the type of data they accept. So then I transform the data I have based on what the model expects to receive. |
@luiscib3r i didn't getting any errors.but i am not getting the expected result.the model is trained by another developer. previously i was working with flutter_tflite package from pub.dev and i got the perfect result but now i cant do it. |
Can you try with version 0.9.1? That should be a direct clone of the original repo and will help narrow down app vs plugin issues. |
No description provided.
The text was updated successfully, but these errors were encountered: