Comments (9)
Yesterday we found out about this config and solved the problem in that exact way (the first option you suggested)!
Anyway, thank you so much for taking your time to help us. Your solution works. :) @ganaware
I have had a similer problem.
The cause of the problem is that Mono is the default scripting backend for a new unity project for Android.
Unfortunately, Mono can run only for the ARMv7 architecture.So my solution is that:
Project Settings > Player > Android > Other Settings > Configuration
- Select IL2CPP for Scripting Backend
- Uncheck ARMv7 and check ARM64 for Target Architectures
Or, build my own TFLite library for ARMv7
- libnnapi_delegate.so, libtensorflowlite_c.so, libtensorflowlite_gpu_delegate.so
- They worked fine for me.
from tf-lite-unity-sample.
I have had a similer problem.
The cause of the problem is that Mono is the default scripting backend for a new unity project for Android.
Unfortunately, Mono can run only for the ARMv7 architecture.
So my solution is that:
- Project Settings > Player > Android > Other Settings > Configuration
- Select IL2CPP for Scripting Backend
- Uncheck ARMv7 and check ARM64 for Target Architectures
- Or, build my own TFLite library for ARMv7
- libnnapi_delegate.so, libtensorflowlite_c.so, libtensorflowlite_gpu_delegate.so
- They worked fine for me.
from tf-lite-unity-sample.
Hi Roberto, i was facing similar issues on iOS with my iPad. In my case it had to do with the orientation (landscape, portrait etc). So most front-camera-sensors in smart-phones and tablets are rotated by 90 degrees and although Unity is able to compensate for that the inputTexture (WebCamTexture) is not taking account for that. So i had to flip the xAxes of the keypoints (1f-keypoint) and also flip uv's and normals of the face-mesh, but this only works on landscape-mode. You could also rotate your rendercam and mirror the canvas. In the end i was using OpenCV to adjust the textures how needed because it was the cleanest solution for my purposes. Hope this helps.
from tf-lite-unity-sample.
Thanks for sharing it @FrankSpalteholz
@Roberto7766 Do you get any errors on logcat?
from tf-lite-unity-sample.
Thanks @FrankSpalteholz and @asus4.
Using logcat I found out that the issue is with the neural network. If I comment the NN part the camera works well.
Here the logcat result:
2020-10-30 08:09:02.815 20668-20687/? E/Unity: DllNotFoundException: libtensorflowlite_c
at (wrapper managed-to-native) TensorFlowLite.InterpreterOptions.TfLiteInterpreterOptionsCreate()
at TensorFlowLite.InterpreterOptions..ctor () [0x00006] in <9d167a8ec82e4b91b0e30378348ced48>:0
at TensorFlowLite.BaseImagePredictor`1[T]..ctor (System.String modelPath, System.Boolean useGPU) [0x00006] in :0
at TensorFlowLite.SSD..ctor (System.String modelPath) [0x00035] in :0
at SsdSample.Start () [0x00011] in :0
(Filename: Line: 0)
2020-10-30 08:09:07.986 20668-20687/? E/Unity: NullReferenceException: Object reference not set to an instance of an object
at SsdSample.Update () [0x00000] in :0
Maybe I did something wrong setting up the project?
from tf-lite-unity-sample.
It seems like failing to load the TensorFlow Lite library. Please make sure that the CPU isn't 32bit. But I've confirmed some cases that 64bit Android fails as well.
from tf-lite-unity-sample.
It is 64bit. What can be done to move forward? Thks.
from tf-lite-unity-sample.
The only thing I could see from the logcat is that the library is failing to load. We need to investigate the cause of the problem.
from tf-lite-unity-sample.
I've cloned the repo and got it to work on Android, Windows and Linux. I've even added my own Image Classification model, created a new scene, loaded it and got it to work as well.
When I tried creating a new Unity project and then adding the package (using the Package Manager and selecting the package file given in the Packages folder of your repo), I only got it to work with Windows and Linux. For some reason, when using it on Android, it breaks after trying to create instances of InterpreterOptions and Interpreter.
Are you aware of any additional steps that should be performed in order to add the package to a new project?
from tf-lite-unity-sample.
Related Issues (20)
- Unable to support TensorFlow Lite Task Library model? HOT 5
- Accelerator compatibility issue on Android phones HOT 1
- Expose mediapipe config option "min_pose_detection_confidence" HOT 2
- face blendshape and geometry support HOT 4
- CameraTextureBackground doesn't support Built-in Render Pipeline HOT 4
- Custom model in SSD throws exception: TensorFlowLite operation failed HOT 3
- When the Graphics API is set to OpenGLES3, the ssd tracking does not work. HOT 2
- Fails TFLite Android build on CircleCI HOT 6
- deeplabv3_257_mv_gpu.tflite question HOT 2
- Having multiple tflite models deployed on same application HOT 5
- Better camera quality or a plugin instead of WebcamTexture HOT 1
- Facing Issue with Custom Model Integration HOT 2
- Map the landmarks on BlazePose Sample into a 3D avatar: eg Unity Chan? HOT 3
- Gpu Accelerator not working for linux x86_64. HOT 2
- undefined symbol errors on Xcode HOT 2
- This TensorFlow Lite and the one Xamarin - identical? HOT 1
- DllNotFoundException: libtensorflowlite_jni HOT 2
- Audio classification will produce different results on different runs HOT 9
- Blazepose runs very slowly on mobile HOT 1
- using static image instead of WebCamTexture on BlazePose HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tf-lite-unity-sample.