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

[Question] will desktop support be added again? #64

Closed
CaptainDario opened this issue May 24, 2023 · 16 comments
Closed

[Question] will desktop support be added again? #64

CaptainDario opened this issue May 24, 2023 · 16 comments

Comments

@CaptainDario
Copy link
Contributor

Basically, what the title says. The old repo had desktop support and it has been removed in this repo. Are there plans for supporting desktop platforms again?

@PaulTR
Copy link
Collaborator

PaulTR commented May 24, 2023

Hey. I'd like to at some point, but it isn't on the roadmap for now. First goal was to get things modernized and I'm going to start on additional samples soon.

@CaptainDario
Copy link
Contributor Author

Thank you for the quick reply.
That's quite sad to hear as my desktop app relies on TF Lite, then gonna stick with the old repo for now.
Is there a specific reason why it has been removed as it was working as intended?

@PaulTR
Copy link
Collaborator

PaulTR commented May 24, 2023

Mainly because it was only working in kind of limited cases, and the API (2.2 I think?) was really far behind. Narrowing the scope helps get things rolling a little faster, then expansions can go back in. From what I could tell with the older repo, desktop support was the last thing to be added in one update, so was still sort of an alpha feature.

@CaptainDario
Copy link
Contributor Author

CaptainDario commented May 25, 2023

I am not sure which limitations you are talking about as I did never see difference between mobile and desktop. But this can also be due to me not using much of TF Lite just some Conv Nets.
However, when I build a TF Lite binary with CMake I didn't encounter problems with any TF Lite version (tried: 2.5, 2.8) as the plugin just loads the dynamic library. Except on Linux, there was a PR that does things differently.

Could you maybe somewhere write down the current roadmap? Would be quite interesting to see and maybe also motivate some community contributions.

@PaulTR
Copy link
Collaborator

PaulTR commented May 25, 2023

Honest answer is there isn't really a current roadmap :p

I started getting this plugin back under regular maintenance because I think it's important and shouldn't just sit idle for a few years, but eng/product want to see adoption and results before investing from their teams (I'm in ML DevRel, so a separate area). Next month (during I/O Connect in Amsterdam) I'm talking with someone who works with the FlutterFire team to see how they do their support and feature development now that this has been getting some legs. Other than that, this is still a very-much community pushed project, but I'll try to get a list of things together for it.

Now that we're on 2.12, acceleration service and delegates are going to be the next big focus for features I think. I'll talk to product when they're ready to see what priorities should be from there as I ramp up on how this all works under the hood.

@CaptainDario
Copy link
Contributor Author

What would be the requirements for a desktop implementation? Depending on how difficult they are, I could invest some work into it.

@PaulTR
Copy link
Collaborator

PaulTR commented May 30, 2023

I think the biggest thing is thorough testing. Desktop for mac requires Intel based, M1, and M2 testing. I'm not 100% on if it works for Windows (I haven't actually worked with Flutter for Desktop yet), but that could also require some setup and testing. I'd say basically making sure all of the existing samples work would be a solid starting point, then documenting the edge cases where things fall apart.

@CaptainDario
Copy link
Contributor Author

I can give it a shot in the coming days. I can try it on Windows and M1 Mac.

I guess to to follow the same approach as on mobile, using pre-built binaries would be preffered. Is there a repo (or something) with desktop TF Lite binaries?

@CaptainDario
Copy link
Contributor Author

CaptainDario commented May 30, 2023

Do you by any chance have experience with .podspec and how to include libraries with it? I am not able to include the library using the macOS podspec. I tried adding it as a vendored_library like this

s.vendored_libraries = 'libtensorflowlite_c-mac.dylib'

but in flutter it cannot find the library

Therefore, I added the .dylib as bundle resource to the example projects and get these results (WiP):

  • ✅ image classification mobilenet (image picker needed a version bump)
    • .camera and image picker plugin are not supported on desktop.
  • ✅ text classification
  • style transfer
  • super resolution esrgan

@PaulTR
Copy link
Collaborator

PaulTR commented Jun 1, 2023

Oh no. Yeah I honestly don't know - let me ping some iOS folks to see what they think. My guess is you're going to run into the same issue with style transfer and super resolution, as well, since they also access the library gallery and camera.

@PaulTR
Copy link
Collaborator

PaulTR commented Jun 1, 2023

Might also be a good StackOverflow question since it's less TFLite related and more platform in general.

@CaptainDario
Copy link
Contributor Author

My guess is you're going to run into the same issue with style transfer and super resolution, as well, since they also access the library gallery and camera.

The app actually compiles fine and there happens a runtime exception when pressing the button. I can adapt the examples to use file picker. Then it can be tested on Desktop.

@CaptainDario
Copy link
Contributor Author

CaptainDario commented Jun 1, 2023

Might also be a good StackOverflow question since it's less TFLite related and more platform in general.

To be honest, there are already a lot of question on SO about this (some indicator that it's not that obvious how to do it). I tried a few with no success, would really appreciate some guidance on this as I have nearly no experience in this regard. Windows and Linux should be much easier for me as they use CMake.

@allyssonmast
Copy link

Might also be a good StackOverflow question since it's less TFLite related and more platform in general.

To be honest, there are already a lot of question on SO about this (some indicator that it's not that obvious how to do it). I tried a few with no success, would really appreciate some guidance on this as I have nearly no experience in this regard. Windows and Linux should be much easier for me as they use CMake.

Has there been any progress?

@CaptainDario
Copy link
Contributor Author

@allyssonmast see here

@PaulTR
Copy link
Collaborator

PaulTR commented Oct 2, 2023

Going to close this since you've done the work for MacOS and know what's going on :)

@PaulTR PaulTR closed this as completed Oct 2, 2023
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

3 participants