am15h / tflite_flutter_helper

TensorFlow Lite Flutter Helper Library
https://pub.dev/packages/tflite_flutter_helper
Apache License 2.0
159 stars 284 forks source link

Upgrade Image Dependency #70

Open charlieforward9 opened 1 year ago

charlieforward9 commented 1 year ago

This package is preventing me from upgrading other packages due to version dependency conflicts! Please resolve and re-release.

mohyghb commented 1 year ago

The camera package needs to be updated as well please.

GauravAppdidGithub commented 1 year ago

pdf package also requires image: ^4.0.0

GauravAppdidGithub commented 1 year ago

any updates?

pnyompen commented 1 year ago

Hi,

I understand the frustration caused by the version dependency conflicts. I've made some changes to the package that should help resolve this issue. You can use my version of the package by adding the following to your pubspec.yaml:

tflite_flutter_helper:
  git:
    url: https://github.com/pnyompen/tflite_flutter_helper.git
    ref: 43e87d4b9627539266dc20250beb35bf36320dce

Also, I've created a pull request with the changes here: https://github.com/elephantum/tflite_flutter_helper/pull/2

Please let me know if this helps!

thulasirmn commented 1 year ago

Hi , @pnyompen ive using the same depedency as you mentioned in the comment but im getting this error on my Build please help me to resolve this

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':tflite_flutter_helper' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50`
Megatronicus commented 1 year ago

It says here https://pub.dev/packages/tflite_flutter_helper/score This project has been discontinued?

pse403 commented 1 year ago

The project is definitely discontinued. I emailed the Google contact and they said that users who need this lib should consult one of their pipeline services. (Google took this over from the original dev).

That being said, I've been trying to update this lib to work with Image 4.0, since it would be a lot more convenient and my use case does not really merit a service, or a big re-write for that matter. When the Image library moved to 4.0 a lot of breaking changes came along with it (https://pub.dev/packages/image/versions/4.0.0). It seems it would be a relatively easy matter to make some changes and get it working, but I've been running into issues. There is no migration guide from 3 > 4 for the Image library, so you have to go into the source code and look around to find what your specific function calls now need, in a lot of cases. Some functions have been combined, some changed. You access image data and manipulate it differently now-- sometimes that poses challenges for this (tf helper) library, especially if some of the operations taking place are new to you (as they are to me). So it's a little project.

(I have no connection to this library, I just have been using it).

charlieforward9 commented 1 year ago

@pse403 Could you provide a link to the pipeline services offered that would be a replacement for this?

bazinac commented 1 year ago

@charlieforward9 , Wondering about the same.

pse403 commented 1 year ago

@charlieforward9 @bazinac : https://developers.google.com/mediapipe

pse403 commented 1 year ago

For anyone else who finds this, the full response from Google was:

<< Hey. So the vision is that flutter-tflite is going to be more of a 'power user' tool for the tensorflow lite interpreter. Out-of-the-box tasks, like what the helper handled, will be incorporated into a separate plugin for MediaPipe over the next few months. There's no plans to touch on the helper (honestly, the helper kind of filled the role of TensorFlow Task Library, but then a plugin for the task library was never built to replace the helper). >>

Megatronicus commented 1 year ago

Never heard of mediapipe until now. Thank you for asking them and posting the answer. Mediapipe only supports android for now. So this will replace tensorflow or be a part of it?

pse403 commented 1 year ago

@Megatronicus you should ask them-- their contact was really helpful and I'd just be guessing. I will say that I just got this lib to work with the latest Image library, but only for processing camera frames from iOS (as far as I currently know). There are things that come up, eg the Image() constructor defaulted to numChannels:4 in the old api (or else that was all it handled, but in any case it worked out of the box with iOS camera frames). In the 4+ versions, that arg defaults to 3. The numChannels arg is optional though, so it wasn't throwing, and I didn't realize amid the rest of the changes. If anyone could use a look at that I can push to my repo here, but it's totally doable overall. Stuff like that.

ghost commented 11 months ago

Good day. I was hoping you might be able to advise if this module is still compatible with Tensorflow Transfer learning using YAMNet for environmental sound classification.

https://www.tensorflow.org/tutorials/audio/transfer_learning_audio

Any information you could provide would be much appreciated.

md-rifatkhan commented 8 months ago

@thulasirmn Go to Android Studio > External Libraries > tflite_flutter_helper-0.3.1 > android > build.gradle from ext.kotlin_version = '1.3.50' to ext.kotlin_version = '1.5.20'