tensorflow / tflite-support

TFLite Support is a toolkit that helps users to develop ML and deploy TFLite models onto mobile / ioT devices.
Apache License 2.0
364 stars 126 forks source link

Tracking: Metadata extration support for both Java and Swift #154

Open sseppola opened 3 years ago

sseppola commented 3 years ago

I would just like to set up an issue to track when this lib can be used to extract labels from a tflite bundle in both iOS and Android. Current support:

For context: I'm using Firebase ML to manage custom models for my apps, however managing the labels separately from the model is a pain point. I prefer to solve uniformly in both apps to keep things simple, so I need both java and swift implementations to be ready.

lu-wang-g commented 3 years ago

The C++ metadata extractor library has been released. We're working on improving the C++ user experience so that it's easy to use when building from source code.

sseppola commented 3 years ago

Excellent! Thank you for the update. I'm not in a hurry to have this in place, so I read your comment as a suggestion to wait until the user experience has been improved before integrating the C++ lib. Is that a fair assessment?

lu-wang-g commented 3 years ago

The improvement will focus on non-bazel experiences, such as using CMake.

BTW, what is the expected workflow for your use case, like which platform (c++/ swift / java), prebuilt binary or built from source code?

sseppola commented 3 years ago

I'm new to native apps, so I'm not sure what tool is being used under the hood, but I can describe the setup.

I've got a React Native app with custom native integration to TFLite, this all builds with default swift/java compilers as far as I know. My project dependencies have been installed from Pods/Maven/npm, so perhaps there's some step in the bundling that compiles source files in there, but this I'm not aware/certain of.

My build.gradle refers to using BUCK for compile dependencies:

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

Does this answer your question? I'm happy to dig a bit further if you give me some direction

lu-wang-g commented 3 years ago

Thanks for your explanation! Seems like the missing piece of work for you is the swift API distributed from Cocoapods. I'll make a note when we planning work for the next quarter. Thanks for the feedback!

sseppola commented 3 years ago

Happy to help! I was starting to expect something more complicated, so I'm looking forward to the cocoapods distribution.