shaqian / flutter_tflite

Flutter plugin for TensorFlow Lite
https://pub.dartlang.org/packages/tflite
MIT License
630 stars 404 forks source link

The plugin `tflite` uses a deprecated version of the Android embedding. #224

Open dia1128 opened 2 years ago

dia1128 commented 2 years ago

I am following the official documents to install tflite. The version I am using is, tflite: 1.0.4. Please help me with this issue.

erikbg7 commented 2 years ago

It is only considered a failure in newer versions of Flutter, V1 embedding is still allowed in Flutter v2.2.3. Download an older version of Flutter or try: flutter downgrade v2.2.3 Hope it works!

Mmisiek commented 2 years ago

Downgrading flutter is not really a solution. When you will migrate tflite ?

dia1128 commented 2 years ago

@erikbg7 Is there any other way around instead of migrating tflite?

vanshg395 commented 2 years ago

@shaqian any updates?

Puspharaj commented 2 years ago

Looks like they discontinued this plugin.

dia1128 commented 2 years ago

@Puspharaj you mean, we can’t use this plugin with flutter anymore?

MichalOneNav commented 2 years ago

I switched to flutter_tflite

Puspharaj commented 2 years ago

@Puspharaj you mean, we can’t use this plugin with flutter anymore?

I had to downgrade all the plugins and flutter to 2.2.3 to get it worked!, But I lost most of the other plugins features because of this plugin, Will give it a try, if not working then will discontinue the project.

Puspharaj commented 2 years ago

I switched to flutter_tflite

tflite_flutter is ok but the boiler plate code, driving me crazy, I'd already downgraded to flutter 2.2.3. Lets see.

Mmisiek commented 2 years ago

It works great with flutter tflite helper plugin.

On Tue, Oct 19, 2021, 20:17 Puspharaj @.***> wrote:

I switched to flutter_tflite

tflite_flutter is ok but the boiler plate code, driving me crazy, I'd already downgraded to flutter 2.2.3. Lets see.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-947285839, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABC7O4O3LSBC2LNE2GB5JLDUHYYFFANCNFSM5EGBHJSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Puspharaj commented 2 years ago

Though downgrade it to 2.2.3, Unfortunately Missing plugin exception were thrown, So now tflite plugin is useless, needless to say.

innerk commented 2 years ago

is there any update on this?

nawzhin95 commented 2 years ago

any update ?

Puspharaj commented 2 years ago

Nope still not updated by her. Looks she gone away forever. Maybe we need to create new plugin.

On Thu, Dec 23, 2021, 00:39 Nawzhin @.***> wrote:

any update ?

— Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-999802539, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDOL56VIVS7QQDZFSSCPYTUSIPABANCNFSM5EGBHJSA . You are receiving this because you were mentioned.Message ID: @.***>

innerk commented 2 years ago

hey @nawzhin95 @Puspharaj , i change to https://pub.dev/packages/tflite_flutter it's working really well

nitinverma-121 commented 2 years ago

I switched to flutter_tflite

can u tell me how the run model using this package??

nitinverma-121 commented 2 years ago

any updates??

Puspharaj commented 2 years ago

nope! discontinued seems!

smartkanak commented 2 years ago

So what is recommended to use from now on if you want to use tensorflow long term on flutter?

dia1128 commented 2 years ago

All of my old projects where I used tflite is not working. I am using tflite_flutter 0.9.0. Which is working good so far. This repository --> https://github.com/am15h/tflite_flutter_plugin helped a lot. If anyone was able to use tflite, please let us know!

dejduu commented 2 years ago

Anything new? Is there any way to use this plugin?

Ifeanyi10 commented 2 years ago

hey @nawzhin95 @Puspharaj , i change to https://pub.dev/packages/tflite_flutter it's working really well

@innerk Please how did you do that. I am finding it difficult to migrate it. I will appreciate it if you can guide me more. Thanks.

innerk commented 2 years ago

@Ifeanyi10 hey, you have to install this 2 packages tflite_flutter: tflite_flutter_helper:

follow the examples and tell me if you have any problem

Ifeanyi10 commented 2 years ago

flutter downgrade v2.2.3

@innerk Thanks for your prompt response. I have installed the two packages and also checked the examples on pub.dev but I am still finding it difficult to implement pose detection. Please can I meet you for about 20 minutes at your free time. We can meet on LinkedIn, Zoom, or any other platform you are okay with. Thanks.

innerk commented 2 years ago

@Ifeanyi10 no problem, add me on google meet carlosreyesinner@gmail.com

AndryCU commented 2 years ago

Finally, what is the best package to use tensorflow...

AndryCU commented 2 years ago

hey @nawzhin95 @Puspharaj , i change to https://pub.dev/packages/tflite_flutter it's working really well @innerk I'm having a problem..when i traid to execute .bat file for window i see a message that say Failed to connect to github.com port 443 after 35 ms: Bad access.

When i traid to enter to this page https://github.com/am15h/tflite_flutter_plugin/releases/download/ i got a 404 error...what i can do?

dejduu commented 2 years ago

@AndryCU Well, i dont know because im not in sight, but i will try to help you anyway. Download this file i attached (depends if it is what you want to download but i guess so), put this into your root of your project, then go to cmd, find root of your project and type install.bat, it should download files (dynamic libraries) you want to. Or you can just replace any .bat file and do that the same way.

install.zip

AndryCU commented 2 years ago

@dejduu same error...look, if you open the file, you can see that it's train to load this page https://github.com/am15h/tflite_flutter_plugin/releases/download/ and if you click it you will see a 404 error..i think that's the problem..

dejduu commented 2 years ago

@AndryCU Ok i understand, but what is your purpose? I think i dont understand what are you trying to achieve. If you are trying to add dynamic libraries which are required, then my guide should work and i need more details of your problem. You can read more here https://pub.dev/packages/tflite_flutter.

AndryCU commented 2 years ago

@dejduu I just want to do the initial setup..i don't know if it's nesesary or not

ekakshjanweja commented 2 years ago

can someone help me out there cause i cant seem to understand the tflite_flutter plugin are there any easy to understand resources or just tell me how do i use the eold plugin

derricktab commented 2 years ago

i think sha qian might have died of COVID-19😢

innerk commented 2 years ago

@derricktab what makes you think that?, She suddenly disappear?

derricktab commented 2 years ago

@derricktab what makes you think that?, She suddenly disappear?

Absolutely, she literally disappeared on every internet platform around the first quarter of 2021.

SSazzadur commented 2 years ago

I am new to the flutter. And I am getting these errors: -> I pick the 'tflite' package, it shows it was deprecated, -> Then I pick 'flutter_tflite' & 'flutter_tflite_helper' which I believe both works together, but here 'flutter_tflite_helper' is deprecated.

Now what should I do? Help me anyone please....

dejduu commented 2 years ago

Hi everyone, so i found one way how to use it. First of all you have to download tflite plugin and make it by yourself to android embedding v2, follow this link, there you can download the original one and from this pull request you should be able to make it. Then just move it to your lib folder, rename it (in my case) to my_new_package, then in your project, in pubspec yaml set this tflite: path: ./my_new_package then import in in your class, in my case import 'package:tflite/tflite.dart';

asy178 commented 2 years ago

@dejduu hi there, could you show a more in depth step how u are able to download the plugin and use it, tqva

dejduu commented 2 years ago

Go there, click on green box, download it, then go there, or just click on pull request and choose 'Migrate to support Android V2 embedding'. Now open your downloaded zip file, copy or move it to your lib file in your project, then change everything how it is described in pull request (this), i also renamed it to my_new_package. Now, when you are done you should in your pubspec.yaml file set path to your local plugin. In pubspec.yaml, section dependencies and under cupertino icons and etc. you will write this tflite: path: ./my_new_package. Now you will import it in your class, you have to basically aim at tflite.dart which is inside of your plugin folder. If you have some troubles just google it im 100% sure you will find answear, anyway you can still dm me to my email if you want.

asy178 commented 2 years ago

@dejduu hi there, thanks for the help, i was able to get the tflite package locally, hopefully its okay and good to go, i got stuck on the camera sadly, the camera plugin has to be camera: 0.9.7+1 not the latest 0.9.8 to use with tflite. On android 11 the camera: 0.9.7+1 cant open due to some deprecated issues due to android device model, i tested using xiaomi redmi, the interface just black not connect with the camera. But in android 10 the camera is working so im trying to integrate my model and test it on android 10

dejduu commented 2 years ago

@asy178 Hi, yeah at the moment it is possible only with local package, sadly. Camera is not working on emulators so testing it on real device is the best option. I was using camera: ^0.9.4+16 with a image_picker: ^0.8.4+2 and it is working fine on every mobile i was testing.

asy178 commented 2 years ago

@dejduu i can't thank you enough for your help! i'll try those version out on my project

NavidHosseini commented 2 years ago

Hello, you can use my repo

tflite_maven: git: url: https://github.com/NavidHosseini/tflite.git ref: master

Its is work fine for now

example : https://github.com/NavidHosseini/tflite/blob/master/example/example%20real%20time.rar

Tiran-Jayasekara commented 1 year ago

@innerk Tflite.runmodelonframe, how we can use this with tflite_flutter: tflite_flutter_helper: can you help me plz?

iSHAANphaye commented 1 year ago

Go there, click on green box, download it, then go there, or just click on pull request and choose 'Migrate to support Android V2 embedding'. Now open your downloaded zip file, copy or move it to your lib file in your project, then change everything how it is described in pull request (this), i also renamed it to my_new_package. Now, when you are done you should in your pubspec.yaml file set path to your local plugin. In pubspec.yaml, section dependencies and under cupertino icons and etc. you will write this tflite: path: ./my_new_package. Now you will import it in your class, you have to basically aim at tflite.dart which is inside of your plugin folder. If you have some troubles just google it im 100% sure you will find answear, anyway you can still dm me to my email if you want.

Hello. What do you mean by copying it? Do I copy the zip folder of the tflite plugin as whole to the lib folder in the object detection app? Also, it tells 'The plugin tflite requires your app to be migrated to the Android embedding v2'

dejduu commented 1 year ago

Hi, yes, copy it (the folder you want to change later on by rewriting it) and move it into your project folder

On Mon 10. 4. 2023 at 14:08, Ishaan Phaye @.***> wrote:

Go there https://github.com/shaqian/flutter_tflite, click on green box, download it, then go there https://github.com/shaqian/flutter_tflite/pull/230/files, or just click on pull request and choose 'Migrate to support Android V2 embedding'. Now open your downloaded zip file, copy or move it to your lib file in your project, then change everything how it is described in pull request (this https://github.com/shaqian/flutter_tflite/pull/230/files), i also renamed it to my_new_package. Now, when you are done you should in your pubspec.yaml file set path to your local plugin. In pubspec.yaml, section dependencies and under cupertino icons and etc. you will write this tflite: path: ./my_new_package. Now you will import it in your class, you have to basically aim at tflite.dart which is inside of your plugin folder. If you have some troubles just google it im 100% sure you will find answear, anyway you can still dm me to my email if you want.

Hello. What do you mean by copying it? Do I copy the zip folder of the tflite plugin as whole to the lib folder in the object detection app?

— Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1501745454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOLPK7PIPVBM5AYFPM5JWNDXAPZ3HANCNFSM5EGBHJSA . You are receiving this because you were mentioned.Message ID: @.***>

-- S pozdravem / Best Regards Daniel Senčišin

iSHAANphaye commented 1 year ago

I did everything as you asked. I even migrated the app to the v2 embedding by following the instructions in ' https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'. Also, when i build the flutter app it says build successful, but the app crashes with the error message: 1: C:\App Dev\Flutter.pub-cache\hosted\pub.dartlang.org\camera-0.5.7+4\android\src\main\java\io\flutter\plugins\camera\CameraPlugin.java uses or overrides a deprecated API. 2: Recompile with -Xlint:deprecation for details. 3: C:\Users\ishaan phaye\Downloads\Compressed\flutter_realtime_detection-master\flutter_realtime_detection-master\lib\tflite_plugin\android\src\main\java\sq\flutter\tflite\TflitePlugin.java uses unchecked or unsafe operations. 4: Recompile with -Xlint:unchecked for details. However, when i change the compileSdkVersion in the build.gradle file from 29 to 33, the 3rd error goes away, but 1st error still persists. Please help in this regard.

dejduu commented 1 year ago

Hi, did you figured it out? If not, can you please send me list of your imported plugins with versions? Thanks.

út 11. 4. 2023 v 12:13 odesílatel Ishaan Phaye @.***> napsal:

I did everything as you asked. I even migrated the app to the v2 embedding by following the instructions in ' https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects '. Also, when i build the flutter app it says build successful, but the app crashes with the error message: 1: C:\App Dev\Flutter.pub-cache\hosted\pub.dartlang.org \camera-0.5.7+4\android\src\main\java\io\flutter\plugins\camera\CameraPlugin.java uses or overrides a deprecated API. 2: Recompile with -Xlint:deprecation for details. 3: C:\Users\ishaan

phaye\Downloads\Compressed\flutter_realtime_detection-master\flutter_realtime_detection-master\lib\tflite_plugin\android\src\main\java\sq\flutter\tflite\TflitePlugin.java uses unchecked or unsafe operations. 4: Recompile with -Xlint:unchecked for details. However, when i change the compileSdkVersion in the build.gradle file from 29 to 33, the 3rd error goes away, but 1st error still persists. Please help in this regard.

— Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1503049615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOLPK7PXM6KD5ZEZREGQLX3XAUVFRANCNFSM5EGBHJSA . You are receiving this because you were mentioned.Message ID: @.***>

-- S pozdravem / Best Regards Daniel Senčišin

iSHAANphaye commented 1 year ago

Hi, sadly no. The imported plugins in the main app are: async 2.10.0 (2.11.0 available) camera 0.5.7+4 (0.10.4 available) characters 1.2.1 (1.3.0 available) collection 1.17.0 (1.17.1 available) cupertino_icons 0.1.3 (1.0.5 available) js 0.6.5 (0.6.7 available) matcher 0.12.13 (0.12.15 available) material_color_utilities 0.2.0 (0.3.0 available) meta 1.8.0 (1.9.1 available) path 1.8.2 (1.8.3 available) source_span 1.9.1 (1.10.0 available) test_api 0.4.16 (0.5.1 available) The imported plugins in tflite package are: async 2.10.0 (2.11.0 available) characters 1.2.1 (1.3.0 available) collection 1.17.0 (1.17.1 available) js 0.6.5 (0.6.7 available) matcher 0.12.13 (0.12.15 available) material_color_utilities 0.2.0 (0.3.0 available) meta 1.8.0 (1.9.1 available) path 1.8.2 (1.8.3 available) source_span 1.9.1 (1.10.0 available) test 1.22.0 (1.24.1 available) test_api 0.4.16 (0.5.1 available) test_core 0.4.20 (0.5.1 available) vm_service 9.4.0 (11.3.0 available) I haven't upgraded any, when I do they throw a series of errors.

On Thu, Apr 13, 2023 at 4:23 PM Daniel @.***> wrote:

Hi, did you figured it out? If not, can you please send me list of your imported plugins with versions? Thanks.

út 11. 4. 2023 v 12:13 odesílatel Ishaan Phaye @.***> napsal:

I did everything as you asked. I even migrated the app to the v2 embedding by following the instructions in '

https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects '. Also, when i build the flutter app it says build successful, but the app crashes with the error message: 1: C:\App Dev\Flutter.pub-cache\hosted\pub.dartlang.org

\camera-0.5.7+4\android\src\main\java\io\flutter\plugins\camera\CameraPlugin.java uses or overrides a deprecated API. 2: Recompile with -Xlint:deprecation for details. 3: C:\Users\ishaan

phaye\Downloads\Compressed\flutter_realtime_detection-master\flutter_realtime_detection-master\lib\tflite_plugin\android\src\main\java\sq\flutter\tflite\TflitePlugin.java uses unchecked or unsafe operations. 4: Recompile with -Xlint:unchecked for details. However, when i change the compileSdkVersion in the build.gradle file from 29 to 33, the 3rd error goes away, but 1st error still persists. Please help in this regard.

— Reply to this email directly, view it on GitHub < https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1503049615 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOLPK7PXM6KD5ZEZREGQLX3XAUVFRANCNFSM5EGBHJSA

. You are receiving this because you were mentioned.Message ID: @.***>

-- S pozdravem / Best Regards Daniel Senčišin

— Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1506755887, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASBHWCPLMYV4KVPSYKXAMKTXA7LI5ANCNFSM5EGBHJSA . You are receiving this because you commented.Message ID: @.***>

dejduu commented 1 year ago

It has been a year since i last started my application, however you have different version. I can send you mine pubspec.yaml to compare and try, otherwise this is a too much inside problem of your application and im not sure how can i help you. Without running application before me im armless.

name: cooky description: A new Flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment: sdk: ">=2.11.0 <3.0.0" #sdk: ">=2.11.0 <3.0.0" ">=2.12.0 <3.0.0"

dependencies: flutter: sdk: flutter tflite: path: ./my_new_package

cupertino_icons: ^1.0.2

tflite: ^1.1.2

image_picker: ^0.8.4+2 get_it: "7.2.0" file_picker: "4.0.1" firebase_core: ^1.6.0 firebase_auth: ^3.2.0 provider: ^6.0.1 cloud_firestore: ^3.1.5 http: ^0.13.4 get: ^4.5.1 tflite_flutter: ^0.9.0 path_provider: ^2.0.9 path: ^1.8.0 camera: ^0.9.4+16 #camera: ^0.8.1+3 image_cropper: ^1.4.1 tflite_flutter_helper: ^0.3.0 #tflite_flutter_helper: ^0.3.1 firebase_storage: "10.0.3" flutter_spinkit: "5.1.0" timeago: "3.1.0" permission_handler: flutter_keyboard_visibility: "5.0.3"

dependency_overrides: firebase_messaging_platform_interface: 3.1.6 firebase_crashlytics_platform_interface: 3.1.13 cloud_firestore_platform_interface: 5.4.13 firebase_auth_platform_interface: 6.1.11 firebase_storage_platform_interface: 4.0.14 cloud_functions_platform_interface: 5.0.21 firebase_analytics_platform_interface: 3.0.5 firebase_remote_config_platform_interface: 1.0.5 firebase_dynamic_links_platform_interface: 0.2.0+5 firebase_performance_platform_interface: 0.1.0+5 firebase_app_installations_platform_interface: 0.1.0+6

dev_dependencies: flutter_test: sdk: flutter

flutter_lints: ^1.0.0 flutter_svg: ^0.23.0+1

flutter: uses-material-design: true assets:

importuje se mi vse z te slozky, bez nutnosti to vypisovat

 - assets/images/
 - assets/icons/
 - assets/recognization/
 - detect.tflite
 - labelmap.txt

čt 13. 4. 2023 v 15:51 odesílatel Ishaan Phaye @.***> napsal:

Hi, sadly no. The imported plugins in the main app are: async 2.10.0 (2.11.0 available) camera 0.5.7+4 (0.10.4 available) characters 1.2.1 (1.3.0 available) collection 1.17.0 (1.17.1 available) cupertino_icons 0.1.3 (1.0.5 available) js 0.6.5 (0.6.7 available) matcher 0.12.13 (0.12.15 available) material_color_utilities 0.2.0 (0.3.0 available) meta 1.8.0 (1.9.1 available) path 1.8.2 (1.8.3 available) source_span 1.9.1 (1.10.0 available) test_api 0.4.16 (0.5.1 available) The imported plugins in tflite package are: async 2.10.0 (2.11.0 available) characters 1.2.1 (1.3.0 available) collection 1.17.0 (1.17.1 available) js 0.6.5 (0.6.7 available) matcher 0.12.13 (0.12.15 available) material_color_utilities 0.2.0 (0.3.0 available) meta 1.8.0 (1.9.1 available) path 1.8.2 (1.8.3 available) source_span 1.9.1 (1.10.0 available) test 1.22.0 (1.24.1 available) test_api 0.4.16 (0.5.1 available) test_core 0.4.20 (0.5.1 available) vm_service 9.4.0 (11.3.0 available) I haven't upgraded any, when I do they throw a series of errors.

On Thu, Apr 13, 2023 at 4:23 PM Daniel @.***> wrote:

Hi, did you figured it out? If not, can you please send me list of your imported plugins with versions? Thanks.

út 11. 4. 2023 v 12:13 odesílatel Ishaan Phaye @.***> napsal:

I did everything as you asked. I even migrated the app to the v2 embedding by following the instructions in '

https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

'. Also, when i build the flutter app it says build successful, but the app crashes with the error message: 1: C:\App Dev\Flutter.pub-cache\hosted\pub.dartlang.org

\camera-0.5.7+4\android\src\main\java\io\flutter\plugins\camera\CameraPlugin.java

uses or overrides a deprecated API. 2: Recompile with -Xlint:deprecation for details. 3: C:\Users\ishaan

phaye\Downloads\Compressed\flutter_realtime_detection-master\flutter_realtime_detection-master\lib\tflite_plugin\android\src\main\java\sq\flutter\tflite\TflitePlugin.java

uses unchecked or unsafe operations. 4: Recompile with -Xlint:unchecked for details. However, when i change the compileSdkVersion in the build.gradle file from 29 to 33, the 3rd error goes away, but 1st error still persists. Please help in this regard.

— Reply to this email directly, view it on GitHub <

https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1503049615

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOLPK7PXM6KD5ZEZREGQLX3XAUVFRANCNFSM5EGBHJSA

. You are receiving this because you were mentioned.Message ID: @.***>

-- S pozdravem / Best Regards Daniel Senčišin

— Reply to this email directly, view it on GitHub < https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1506755887 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ASBHWCPLMYV4KVPSYKXAMKTXA7LI5ANCNFSM5EGBHJSA

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/224#issuecomment-1507000206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOLPK7OBOMREDMCTSAUL363XBAAFLANCNFSM5EGBHJSA . You are receiving this because you were mentioned.Message ID: @.***>

-- S pozdravem / Best Regards Daniel Senčišin