Ionic Capacitor - loadFromUri
See original GitHub issueAfter i changed from a ionic cordova to capacitor build i experience issues loading the models. On my PWA everything is working and the models are placed in the www/assests/models folder. But when i try to run the native android build i get this error message
Error: Uncaught (in promise): Error: Based on the provided shape, [1,1,512,512], the tensor should have 262144 values but has 216607
Error: Based on the provided shape, [1,1,512,512], the tensor should have 262144 values but has 216607
at d (http://localhost/vendor.js:100321:4453)
at dn (http://localhost/vendor.js:100321:71403)
at fn (http://localhost/vendor.js:100321:70965)
at o (http://localhost/vendor.js:100321:444184)
at _c (http://localhost/vendor.js:100321:444219)
at http://localhost/vendor.js:100321:463380
at Array.forEach (<anonymous>)
at http://localhost/vendor.js:100321:463354
at Array.forEach (<anonymous>)
at http://localhost/vendor.js:100321:463142
In my previous build for the native android app with cordova the models where located at assets/www/assets/models now with capacitor the folder structure changed to assets/public/assets/models.
I load ssd with
await faceapi.nets.ssdMobilenetv1.loadFromUri('assets/models');
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
App Capacitor Plugin API
The App API handles high level App state and events.For example, this API emits events when the app enters and leaves the foreground,...
Read more >Ionic Capacitor - loadFromUri - face-api.js - GitAnswer
Ionic Capacitor - loadFromUri - face-api.js. After i changed from a ionic cordova to capacitor build i experience issues loading the models.
Read more >Ionic/Capacitor iOS App does not load script from a third party ...
I am currently working on an ionic/react app using capacitor to "compile" it into android and iOS Apps. Right now the app itself...
Read more >Develop 99% of your Ionic app in the browser with Capacitor
One of the guiding design goals of Capacitor, Ionic's new native web app container project that runs your web app natively on iOS,...
Read more >Announcing Capacitor 1.0.0 Alpha - Ionic Blog
Capacitor aims to build a better Native runtime for the future of Ionic apps running everywhere: iOS, Android, Electron, and on the web...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I use ionic with capacitor and load the models in this way:
await faceapi.loadSsdMobilenetv1Model('/assets/models');
await faceapi.loadFaceLandmarkModel('/assets/models');
The extension of the models changed them to bin
Similarly in the .json files
Running on android and ios 🎉🎉
Hi I rename models to .bin and change this in json but say error in android
2020-11-16 15:35:27.015 24121-24121/systemsweb.net E/Capacitor/Console: File: http://localhost/vendor-es2015.js - Line 41309 - Msg: ERROR Error: Uncaught (in promise): Error: SsdMobilenetv1 - load model before inference Error: SsdMobilenetv1 - load model before inference at SsdMobilenetv1.push…/node_modules/face-api.js/build/es6/ssdMobilenetv1/SsdMobilenetv1.js.SsdMobilenetv1.forwardInput (http://localhost/tab3-tab3-module-es2015.js:13925:19) at SsdMobilenetv1.<anonymous> (http://localhost/tab3-tab3-module-es2015.js:13959:35) at step (http://localhost/vendor-es2015.js:123912:23) at Object.next (http://localhost/vendor-es2015.js:123893:53) at fulfilled (http://localhost/vendor-es2015.js:123883:58) at ZoneDelegate.invoke (http://localhost/polyfills-es2015.js:3470:30) at Object.onInvoke (http://localhost/vendor-es2015.js:73011:33) at ZoneDelegate.invoke (http://localhost/polyfills-es2015.js:3469:36) at Zone.run (http://localhost/polyfills-es2015.js:3229:47) at http://localhost/polyfills-es2015.js:3963:40