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

Add NN Api Delegate #270

Merged
merged 7 commits into from
Dec 27, 2022
Merged

Add NN Api Delegate #270

merged 7 commits into from
Dec 27, 2022

Conversation

asus4
Copy link
Owner

@asus4 asus4 commented Dec 27, 2022

Android Neural Networks API has been supported as an useNNAPI option in the InterpreterOptions.cs. But there was no way to configure options in the NNAPI.

This PR allows configuring all options supported in the original TFLite CAPI.

Please take a look at SsdSample.cs for an example of usage.

@asus4 asus4 added the Android label Dec 27, 2022
@asus4
Copy link
Owner Author

asus4 commented Dec 27, 2022

How to test the new NNAPI delegate

  1. Open the SSD sample scene
  2. Change the Accelerator option to NNPAI
  3. Build and run it on your Android
  4. See log in the logcat

The first time you start the app, you'll see the following warning.

12-27 14:03:58.261 17049 17138 W Unity   : TFLite Warning: File /storage/emulated/0/Android/data/com.asus4.tfliteunitysample/files/ssd-token_5504566449498313531.bin couldn't be opened for reading: No such file or directory

From the second time onwards, you won't see such a warning.

@asus4 asus4 merged commit b1e6b41 into master Dec 27, 2022
@asus4 asus4 deleted the nnapi-delegate branch December 27, 2022 14:28
@asus4 asus4 mentioned this pull request Apr 21, 2023
AhmadMendung pushed a commit to AhmadMendung/tf-lite-unity-sample that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant