shaqian / flutter_realtime_detection Goto Github PK
View Code? Open in Web Editor NEWReal-time detection demo for Flutter tflite plugin
Real-time detection demo for Flutter tflite plugin
App successfully builts on Android. but get this error on IOS
Code : https://github.com/Techno-Disaster/PlushieMate
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET tflite OF PROJECT Pods WITH CONFIGURATION Debug ===
/usr/local/bin/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.0.4/ios/Classes/TflitePlugin.mm:19:10: fatal error: 'tensorflow/lite/kernels/register.h' file not found
#include "tensorflow/lite/kernels/register.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
I tried several times and on several devices and emulators but the detection is only working on some devices perfectly. Please suggest and advice.
Thanks in advance
@shaqian
Note: /home/irotech/Desktop/flutter_linux_v1.7.8+hotfix.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/tflite-1.0.4/android/src/main/java/sq/flutter/tflite/TflitePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I am continuously getting this error and i have tried all the version of Tflite till 1.0.1, but still getting the same error.
I use my custom tflite to try this code, and I found Android performs much much better than IOS. Do you have any idea?
Android: good accuracy and quick.
IOS: wrong prediction (seems like flipped result horizontally) and most of time no prediction.
Tim
when I use the front camera like this:
controller = new CameraController(
widget.cameras[1],
ResolutionPreset.high,
);
... the pose estimation key points seem way off. Could you please let me know which parameter settings I need to adjust to make it work for the front camera as well?
I followed the article you wrote about this on Medium and everything has worked for me except the section “Decoding CameraImage”. Could you tell me where I should include the code snippet that you provided (feed-ios.mm) in the native iOS code?
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\MainActivity.java:24: ����: [deprecation] PluginRegistry�е�Registrar�ѹ�ʱ
import io.flutter.plugin.common.PluginRegistry.Registrar;
^
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:17: ����: �����com.baidu.paddle.lite������
import com.baidu.paddle.lite.MobileConfig;
^
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:18: ����: �����com.baidu.paddle.lite������
import com.baidu.paddle.lite.PaddlePredictor;
^
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:19: ����: �����com.baidu.paddle.lite������
import com.baidu.paddle.lite.PowerMode;
^
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:20: ����: �����com.baidu.paddle.lite������
import com.baidu.paddle.lite.Tensor;
^
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:47: ����: �Ҳ�������
protected PaddlePredictor paddlePredictor = null;
^
����: �� PaddlePredictor
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:191: ����: �Ҳ�������
public Tensor getInput(int idx) {
^
����: �� Tensor
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:198: ����: �Ҳ�������
public Tensor getOutput(int idx) {
^
����: �� Tensor
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:131: ����: �Ҳ�������
MobileConfig config = new MobileConfig();
^
����: �� MobileConfig
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:131: ����: �Ҳ�������
MobileConfig config = new MobileConfig();
^
����: �� MobileConfig
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:135: ����: �Ҳ�������
config.setPowerMode(PowerMode.LITE_POWER_HIGH);
^
����: ���� PowerMode
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:137: ����: �Ҳ�������
config.setPowerMode(PowerMode.LITE_POWER_LOW);
^
����: ���� PowerMode
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:139: ����: �Ҳ�������
config.setPowerMode(PowerMode.LITE_POWER_FULL);
^
����: ���� PowerMode
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:141: ����: �Ҳ�������
config.setPowerMode(PowerMode.LITE_POWER_NO_BIND);
^
����: ���� PowerMode
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:143: ����: �Ҳ�������
config.setPowerMode(PowerMode.LITE_POWER_RAND_HIGH);
^
����: ���� PowerMode
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:145: ����: �Ҳ�������
config.setPowerMode(PowerMode.LITE_POWER_RAND_LOW);
^
����: ���� PowerMode
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:150: ����: �Ҳ�������
paddlePredictor = PaddlePredictor.createPaddlePredictor(config);
^
����: ���� PaddlePredictor
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:214: ����: �Ҳ�������
Tensor inputTensor0 = getInput(0);
^
����: �� Tensor
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:216: ����: �Ҳ�������
Tensor inputTensor1 = getInput(1);
^
����: �� Tensor
�: �� Predictor
\Documents\GitHub\realtime-object-detector\android\app\src\main\java\com\example\realtimeod\Predictor.java:277: ����: �Ҳ�������
Tensor outputTensor = getOutput(0);
^
����: �� Tensor
�: �� Predictor
19 ������
1 ������
FAILURE: Build failed with an exception.
i met problems above, I would be very grateful if you could help me
Running this project gives the following warning:
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects```
I can do a PR to fix this if you want.
Hi @panmari @erjanmx @mitchross @shaqian @techno-disaster
I had successfully implemented the tflite package in flutter but at last we are getting the output in that we are getting like {{confidence: 0.6352049112319946, index: 9, label: corn maize }} i want to display the only label with specific font and style can you explain how can i get that
Thanks and Regards,
Manikantha Sekhar.
I could successfully build the APK and run it on Android. Everything works fine.
Connected iPhone6 and ran the app. It got launched and I clicked on PoseNet. It asked for camera permission. After I provided the same, the app got crashed. Log shows "Lost connection to device".
Launching lib/main.dart on Gireesh’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 9975RCLFXK
Xcode build done. 18.3s
Installing and launching...
flutter: success
Lost connection to device.
Exited (sigterm)
In Android, I remember it was asking for both Camer & Microphone permissions. But in iPhone, it asked for only Camera permission and crashed.
I checked Settings->Privacy->Microphone. The app is not requesting microphone access.
Any ideas?
It's like the best app I have ever seen
Is it possible to capture video while detecting? If so, is it possible to choose wether to capture the overlay info or not?
Thanks
Hello,
I am trying to run poseNet on camera image. It runs fine on an emulator using the sample android scene with a human picture on the wall. However, when I run my app on my phone it's not able to detect anything. Any ideas to how can I fix this?
Posenet is too slow, even on high end devices.
For POCO F1 (Snapdragon 845 + liquid cooling + Adreno 630) with GPU delegate and 4 threads in Debug mode.
Inference takes around 70ms average
Detection takes around 240ms on average
Takes roughly around the same time even in release mode.
Same issue has been resolved here: tensorflow/tensorflow#34230
How to implement those changes in this app/tflite plugin?
FAILURE: Build failed with an exception.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
Output: /home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/merged/release/values/values.xml:186: error: resource android:attr/fontVariationSettings not found.
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/merged/release/values/values.xml:187: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /home/Techno-Disaster/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/06fcfe37f7cce96046824d41c1d91cd9/aapt2-3.2.1-4818971-linux/aapt2 link -I
/home/Techno-Disaster/Android/Sdk/platforms/android-27/android.jar
--manifest\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/aapt_friendly_merged_manifests/release/processReleaseManifest/aapt/AndroidManifest.xml
-o\
/tmp/aapt-28206924259168528-out\
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-cs_values-cs.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-xhdpi-v4_notify_panel_notification_icon_bg.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-sq_values-sq.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-da_values-da.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ne_values-ne.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-in_values-in.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-vi_values-vi.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-fi_values-fi.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-xhdpi-v4_notification_bg_normal_pressed.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-mdpi-v4_notification_bg_low_pressed.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-hr_values-hr.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-bn_values-bn.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-pt-rPT_values-pt-rPT.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-mdpi-v4_notification_bg_normal_pressed.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-tr_values-tr.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-gl_values-gl.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-hdpi-v4_notify_panel_notification_icon_bg.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ta_values-ta.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-en-rXC_values-en-rXC.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-mdpi-v4_notification_bg_normal.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-nl_values-nl.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-be_values-be.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ru_values-ru.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-as_values-as.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-sv_values-sv.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout_notification_action_tombstone.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-xhdpi-v4_notification_bg_low_pressed.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-sr_values-sr.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ur_values-ur.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-fr_values-fr.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values_values.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-zh-rTW_values-zh-rTW.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-si_values-si.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-hdpi-v4_notification_bg_normal.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-de_values-de.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-lt_values-lt.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-lo_values-lo.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ar_values-ar.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout-v16_notification_template_custom_big.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ms_values-ms.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-az_values-az.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable_notification_icon_background.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ky_values-ky.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-hdpi-v4_notification_bg_low_pressed.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-sl_values-sl.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-zu_values-zu.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-b+sr+Latn_values-b+sr+Latn.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable_notification_tile_bg.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-it_values-it.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable_notification_bg.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-kn_values-kn.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ja_values-ja.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-uk_values-uk.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-fr-rCA_values-fr-rCA.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-es-rUS_values-es-rUS.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-mdpi-v4_notify_panel_notification_icon_bg.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-en-rAU_values-en-rAU.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-is_values-is.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-my_values-my.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-xhdpi-v4_notification_bg_low_normal.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ro_values-ro.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-pa_values-pa.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-pt_values-pt.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-mr_values-mr.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-en-rGB_values-en-rGB.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-te_values-te.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-el_values-el.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-et_values-et.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ko_values-ko.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-or_values-or.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-pl_values-pl.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-nb_values-nb.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout_notification_action.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-gu_values-gu.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-hdpi-v4_notification_bg_normal_pressed.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-fa_values-fa.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ca_values-ca.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-en-rCA_values-en-rCA.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-bg_values-bg.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-eu_values-eu.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-sk_values-sk.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout-v21_notification_template_icon_group.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout-v21_notification_action.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-pt-rBR_values-pt-rBR.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-hu_values-hu.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-sw_values-sw.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-es_values-es.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-lv_values-lv.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-mn_values-mn.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout-v21_notification_template_custom_big.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-hdpi-v4_notification_bg_low_normal.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-mk_values-mk.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-kk_values-kk.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-tl_values-tl.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ml_values-ml.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout-v21_notification_action_tombstone.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable_notification_bg_low.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-v21_notification_action_background.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-th_values-th.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-am_values-am.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-iw_values-iw.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-uz_values-uz.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-af_values-af.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout_notification_template_part_chronometer.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-bs_values-bs.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-zh-rCN_values-zh-rCN.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-en-rIN_values-en-rIN.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-hy_values-hy.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-km_values-km.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-mdpi-v4_notification_bg_low_normal.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-v16_values-v16.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-zh-rHK_values-zh-rHK.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-ka_values-ka.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout_notification_template_icon_group.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/drawable-xhdpi-v4_notification_bg_normal.9.png.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-v21_values-v21.arsc.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/layout_notification_template_part_time.xml.flat
-R\
/home/Techno-Disaster/Flutter/apps/PlushieMate/build/tflite/intermediates/res/compiled/release/values-hi_values-hi.arsc.flat
--auto-add-overlay\
--non-final-ids\
-0\
apk\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1m 11s
I want the app to start with the camera and use only the yolo model. Can you help me? I am new at flutter?
Hello, first of all , your example is just great. I wonder if you can add the support for quantized models to speedup the working of such models like yolo, is it possible?
May I ask you to specify the license as I would like to use a part of your wonderful repository?
E/AndroidRuntime(26797): Process: com.example.examplerealtime, PID: 26797
E/AndroidRuntime(26797): java.lang.IllegalStateException: Session has been closed; further changes are illegal.
E/AndroidRuntime(26797): at android.hardware.camera2.impl.CameraCaptureSessionImpl.checkNotClosed(CameraCaptureSessionImpl.java:666)
E/AndroidRuntime(26797): at android.hardware.camera2.impl.CameraCaptureSessionImpl.setRepeatingRequest(CameraCaptureSessionImpl.java:230)
E/AndroidRuntime(26797): at io.flutter.plugins.camera.CameraPlugin$Camera$7.onConfigured(CameraPlugin.java:739)
E/AndroidRuntime(26797): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26797): at android.hardware.camera2.dispatch.InvokeDispatcher.dispatch(InvokeDispatcher.java:39)
E/AndroidRuntime(26797): at android.hardware.camera2.dispatch.HandlerDispatcher$1.run(HandlerDispatcher.java:65)
E/AndroidRuntime(26797): at android.os.Handler.handleCallback(Handler.java:789)
E/AndroidRuntime(26797): at android.os.Handler.dispatchMessage(Handler.java:98)
E/AndroidRuntime(26797): at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime(26797): at android.app.ActivityThread.main(ActivityThread.java:6721)
E/AndroidRuntime(26797): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(26797): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
E/AndroidRuntime(26797): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
Hey!
I'm just starting to use Flutter por object recognition and i would like to know how can i try this code for myself. I'm using Android Studio, and I don't know what to do or open. Thanks in advance, I know this is a very silly question, but I'm a quick learner, promise :)
HI Shaqian, I really appreciated your work, is fantastic. But, I need help because when I turn the cellphone and go to Landscape view mode with the flutter detection, the live video shown on screen is the same on portrait mode causing block on detection. Is there some fix for this?
The image on screen of cellphone only is shown correct when in portrait mode of cellphone.
Hi.
I have downloaded the repo but when i run it in my android studio ,v3.5, all i get in my emulator/real device is a white screen when opening the app and the console just says "E/BpSurfaceComposerClient(10222): Failed to transact (-1)
E/BpSurfaceComposerClient(10222): Failed to transact (-1)"
. Any help with this would be greatly appreciated.
Hi,
I'm trying to integrate an own model based on mobileNetV2 with the image size 224. The base is the google example
As mobileNet with the same image size is used also for "MobileNet", I reused the button and only changed the path to the custom assets in loadModel():
default:
/* res = await Tflite.loadModel(
model: "assets/ssd_mobilenet.tflite",
labels: "assets/ssd_mobilenet.txt");*/
res = await Tflite.loadModel(
model: "assets/model_flowers.tflite",
labels: "assets/labels_flowers.txt");
unfotunately it doesn't work:
E/AndroidRuntime(28217): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime(28217): Process: com.example.examplerealtime, PID: 28217
E/AndroidRuntime(28217): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(28217): at android.os.AsyncTask$3.done(AsyncTask.java:354)
E/AndroidRuntime(28217): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(28217): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(28217): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(28217): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime(28217): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(28217): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(28217): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(28217): Caused by: java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 5] and a Java object with shape [1, 5, 4].
E/AndroidRuntime(28217): at org.tensorflow.lite.Tensor.throwIfShapeIsIncompatible(Tensor.java:291)
E/AndroidRuntime(28217): at org.tensorflow.lite.Tensor.throwIfDataIsIncompatible(Tensor.java:258)
E/AndroidRuntime(28217): at org.tensorflow.lite.Tensor.copyTo(Tensor.java:150)
E/AndroidRuntime(28217): at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:183)
E/AndroidRuntime(28217): at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:275)
E/AndroidRuntime(28217): at sq.flutter.tflite.TflitePlugin$RunSSDMobileNet.runTflite(TflitePlugin.java:622)
E/AndroidRuntime(28217): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:419)
E/AndroidRuntime(28217): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:393)
E/AndroidRuntime(28217): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime(28217): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(28217): ... 4 more
As far I understand it correctly, the tensor shape passed to the model doesn't correspond to the required tensor shape :
Cannot copy between a TensorFlowLite tensor with shape [1, 5] and a Java object with shape [1, 5, 4]
Unfortunately I am not able to debug sq.flutter.tflite.TflitePlugin.java
What is the correct way to integrate a custom model?
Thank you!
Hi @shaqian, I am trying to build a yoga pose detector application. I have got the tflite model from https://github.com/smellslikeml/YogAI. Model name is model.tflite. I inserted the model in assests folder and added it in pubspec.yaml and also I have changed my model path in loadModel function in home.dart file. I called the runModelOnFrame function in camera.dart file. But I am getting error. Can u please help me with this. This is the error I got:
E/AndroidRuntime( 4091): FATAL EXCEPTION: AsyncTask #2
E/AndroidRuntime( 4091): Process: com.example.ai_project, PID: 4091
E/AndroidRuntime( 4091): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime( 4091): at android.os.AsyncTask$3.done(AsyncTask.java:354)
E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime( 4091): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime( 4091): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime( 4091): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime( 4091): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime( 4091): Caused by: java.lang.IllegalArgumentException: Null outputs are allowed only if the Tensor is bound to a buffer handle.
E/AndroidRuntime( 4091): at org.tensorflow.lite.Tensor.copyTo(Tensor.java:147)
E/AndroidRuntime( 4091): at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:183)
E/AndroidRuntime( 4091): at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:275)
E/AndroidRuntime( 4091): at org.tensorflow.lite.Interpreter.run(Interpreter.java:249)
E/AndroidRuntime( 4091): at sq.flutter.tflite.TflitePlugin$RunModelOnFrame.runTflite(TflitePlugin.java:513)
E/AndroidRuntime( 4091): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:419)
E/AndroidRuntime( 4091): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:393)
E/AndroidRuntime( 4091): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime( 4091): ... 4 more
I/Process ( 4091): Sending signal. PID: 4091 SIG: 9
Lost connection to device.
Exited (sigterm)
Great Project!
In most cases the plugin works as expected. But on some Android devices, such as Nokia 7.2 the object detection does not work at all or inaccurately. There is no error message. The model is inferred correctly, but returns no results.
Is there any hardware/software precondition that should be met, for the plugIn to work?
when I press flutter run, The app gets loaded properly but on my android device it says "flutter_realtime_detection keeps crashing". How do I resolve this ?
Error is:
2019-05-25 23:14:52.335 23090-23126/? E/SDK: [null:167] - SimpleHttpHelper RESPONSE failure:
code=204
result=
url=http://sdk.api.kaffnet.com/v4/cut_v3.php
2019-05-25 23:14:52.336 23090-23142/? D/SDK: [null:122] - SimpleHttpHelper RESPONSE success:
code=200
result=success
url=http://ad.api.kaffnet.com/adserver/v1/sdk/installreport/get?country=US&natural=0&gaid=5bcfe012-f456-4725-9145-e4cd09d57e4f&os_version=7.0&language=en&version=1&token=7701588d-ce77-f111-c7ec-2aae76ea7b4f&pkg_name=com.example.examplerealtime&sdk_version=4.3.1.0.4101.13&imei=&network_type=1&event=0&aid=de47178c80eaf91d&add_time=1558806292021×tamp=1558806292021
2019-05-25 23:14:52.336 23090-23090/? E/SDK: [null:224] - 自然流量跳转失败:pkg=com.example.examplerealtime
2019-05-25 23:14:52.337 23090-23090/? D/SDK: [null:25] - -----------上传成功---------http://ad.api.kaffnet.com/adserver/v1/sdk/installreport/get
2019-05-25 23:14:52.346 923-923/? I/TelecomService: DefaultDialerCache: Refreshing default dialer for user 0: now com.android.dialer: DDC.oR@DEY
2019-05-25 23:14:52.382 4682-4682/? E/--ass--: --in---
2019-05-25 23:14:52.382 4682-4682/? E/--ass--: com.example.examplerealtime----android.widget.FrameLayout
2019-05-25 23:14:52.382 4682-4682/? E/--ass--: --in---
2019-05-25 23:14:52.382 4682-4682/? E/--ass--: com.example.examplerealtime----android.widget.FrameLayout
2019-05-25 23:14:52.502 4682-4682/? E/--ass--: --in---
2019-05-25 23:14:52.502 4682-4682/? E/--ass--: android----android.widget.TextView
2019-05-25 23:14:52.528 4682-4682/? E/--ass--: --in---
2019-05-25 23:14:52.528 4682-4682/? E/--ass--: android----android.widget.FrameLayout
2019-05-25 23:14:52.528 4682-4682/? E/--ass--: --in---
hello,I want to upload CameraImage to the server and display pictures on the server. But I can't upload it with dio or http. So how can I convert cameraImage to File.
Does it support other tflite models such as Yolov5 ?
this is what happens every time I try to run the app:
Initializing gradle... 1.2s
Resolving dependencies...
Configure project :app
Project evaluation failed including an error in afterEvaluate {}. Run with
--stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
Where:
Script '/home/ehsan/FlutterSDK/packages/flutter_tools/gradle/flutter.gradle'
line: 422
What went wrong:
A problem occurred evaluating script.
Failed to apply plugin [class 'FlutterPlugin']
Invalid platform: android-arm64android.enableR8=true.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
Command:
/home/ehsan/AndroidStudioProjects/external_projects/flutter_realtime_detection
/android/gradlew app:properties
Please review your Gradle project setup in the android/ folder.
debug output
Launching lib/main.dart on Kent Hinson’s iPhone in debug mode... Automatically signing iOS for device deployment using specified development team in Xcode project: L2F5C82287 Xcode build done. 11.5s Checking for advertised Dart observatories... Checking for available port on com.example.exampleRealtime._dartobservatory._tcp.local Checking for authentication code for com.example.exampleRealtime._dartobservatory._tcp.local
Crash happens during app launch trying to access the camera. I'm guessing it's a permissions issue.
Exception has occurred. FlutterError (ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. If you're running an application and need to access the binary messenger before
runApp()has been called (for example, during plugin initialization), then you need to explicitly call the
WidgetsFlutterBinding.ensureInitialized()first. If you're running a test, you can call the
TestWidgetsFlutterBinding.ensureInitialized()as the first line in your test's
main() method to initialize the binding.)
The popup asking for camera permission never showed on the phones screen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.