I had trained my model using tensorflow and got saved_model.pb then when i converted to tflite then app is crashing.
@TheCodingNotebook2 ай бұрын
Try to examine the tflite model and see that the inputs/outputs shape is as you expect in the code. Another possibility is that the saved_model contains an operation that is not supported by tflite
@maahinpanchal58283 ай бұрын
Does we can do this with custom dataset ?
@TheCodingNotebook2 ай бұрын
Search for "transfer learning" on SSD models to train the detector on a custom data set
@tskanew48114 ай бұрын
i tried to download from github but app not working i dont understand what should i change in order for it to work and edit it
@tskanew48114 ай бұрын
i wish to help me implement the code because i need it for a project iam working on
@theashbot40975 ай бұрын
I am having a problem with I run the following command bazel build //tensorflow/lite/c:tensorflowlite_c.dll -c opt The error I get is ERROR: C:/users/asher/downloads/tensorflow-master/tensorflow-master/tensorflow/lite/core/c/BUILD:620:38: Compiling tensorflow/lite/core/c/operator.cc failed: (Exit 2): cl.exe failed: error executing command (from target //tensorflow/lite/core/c:operator) cd /d C:/users/asher/_bazel_asher/czw57dhw/execroot/org_tensorflow SET INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\VC\Tools\MSVC\14.39.33519\include;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\VC\Tools\MSVC\14.39.33519\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um SET PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\Tools\;;C:\WINDOWS\system32;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\VC\vcpkg SET PWD=/proc/self/cwd SET PYTHON_BIN_PATH=C:/Users/Asher/AppData/Local/Programs/Python/Python310/python.exe SET PYTHON_LIB_PATH=C:/Users/Asher/AppData/Local/Programs/Python/Python310/lib/site-packages SET TEMP=C:\Users\Asher\AppData\Local\Temp SET TF2_BEHAVIOR=1 SET TMP=C:\Users\Asher\AppData\Local\Temp SET VSLANG=1033 C:\Program Files\Microsoft Visual Studio\2022\Community\Not Catch\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe @bazel-out/x64_windows-opt/bin/tensorflow/lite/core/c/_objs/operator/operator.obj.params # Configuration: a573a2162b95c7cc5b9daaf94f82911ff712cbd8da154051ce4ca73181423383 # Execution platform: @local_execution_config_platform//:platform cl : Command line warning D9002 : ignoring unknown option '-O3' tensorflow/lite/core/c/operator.cc(28): error C7555: use of designated initializers requires at least '/std:c++20' Target //tensorflow/lite/c:tensorflowlite_c.dll failed to build INFO: Elapsed time: 81.130s, Critical Path: 1.67s INFO: 333 processes: 313 internal, 20 local. FAILED: Build did NOT complete successfully Do you know how to fix this by any chance? I have tried installing different bazel version but it does not fix it.
@cattnation62576 ай бұрын
bro i am new to tensorflow i dont use tensor flow directly i use yolo and mideapipe i get this Created TensorFlow Lite XNNPACK delegate for CPU. and speed is quite slow how can i use gpu? so processing speed get fast
@mahmoudnasser78746 ай бұрын
I have a problem , Can't include tflite and open cv on linux as there is no VS on Linux , Did you face that issue ?
@CodeWithImem8 ай бұрын
thank you for your efforts .. and please i have a question .. when i am converting the graph_model into tflite .. the size i got is 198M .. while you got 12M only .. how is that happens ?
@TheCodingNotebook8 ай бұрын
For the exact same model that I used?
@minpark21178 ай бұрын
Hi, Thank you for your great tutorial! I have 1 question. When I run at the xcode in release mode, then It works well. BUT when i did archive and test at testflight, the camera couldn't recognize image. Do you know What's wrong? (I will change cpp file when i deploy my testing app so don't worry about anything. I just curious about possibility of dynamic library with ios)
@TheCodingNotebook8 ай бұрын
Hi, No, I am not an ios developer so I don't have any clue from the top of my head... I usually don't do dynamic lib with opencv.
@minpark21178 ай бұрын
@@TheCodingNotebook Thank you for your reply. I revised my Xcode's setting to solve my problem and it works well! Have a nice day :)
@jonatanbityaev9 ай бұрын
היי יובל אני מקבוצת רובוטיקה מתכנית first ואני ממש אשמח ליצור איתך קשר בנוגע לזה.
@TheCodingNotebook8 ай бұрын
Hi, there's a contact form on the website: www.thecodingnotebook.com
@jonatanbityaev8 ай бұрын
ok thx@@TheCodingNotebook
@arvinds71829 ай бұрын
ERROR: An error occurred during the fetch of repository 'flatbuffers': PLEASE ASSIST
Thank you for your excellent explanation, That was useful for me I wanted to ask you something. I have an issue when I try to open the .tflite model it gives me the error ERROR: The model allocation is null/empty Failed to load model
@TheCodingNotebook10 ай бұрын
I don't recall having this issue, but I always worked with "standard" models provided by Google...
@mahmoudnasser78746 ай бұрын
@@TheCodingNotebook It worked , thank you for the great effort
@SeaUsername11 ай бұрын
merci beaucoup
@TheCodingNotebook11 ай бұрын
With pleasure
@PaulFreemanTheTall Жыл бұрын
This is a very clear explanation both of what goes into a plugin and how to display using OpenGL on Android. I had to do something similar about a year before you published this, and finding this would have saved me quite a bit of time.
@TheCodingNotebook Жыл бұрын
Thx!
@arthurgichuhi Жыл бұрын
This is a great video. Could you do a video or article on how you made the flutter plugin? The video when you integrated OPENCV into android is great, though I can't really grasp how to relate to it in a flutter plugin setting.
@TheCodingNotebook Жыл бұрын
It's all in there, I work on the plugin starting at 04:30
@josealamos2345 Жыл бұрын
When I try to open the native_opencv/example/android folder in android studio. In the project view the group module with native_opencv and app is missing. How do I get them to show up in the project view?
@TheCodingNotebook Жыл бұрын
I never had to change the projects created by flutter...
@TerryDavisMedia Жыл бұрын
this has to be the best tutorial out there for people who don't understand some core concepts, you really go all in detail, I will recommend this to anyone learning raw webgl, you dont use libraries, thank you so much for this <3
@TheCodingNotebook Жыл бұрын
Thank you very much!! I am really happy to see it helps.
@dhaniahsait9549 Жыл бұрын
Hi! Thanks for the video. Where did you get the original model from? How can I put my own model in?
@TheCodingNotebook Жыл бұрын
I talk about it here: kzbin.info/www/bejne/op2onHeCo7Gimac Note it is quite an old video so not sure how much it applies for the latest version on tensorflow.
@prasadd1810 Жыл бұрын
hi can you give same like for currency recognition
@TheCodingNotebook Жыл бұрын
Hi, I don't know of any model for that
@asilepolitiqueasilepolitiq6943 Жыл бұрын
Hi, thank you for your amazing work, these tutorials are super helpful. I've got a question : do you think it is possible to feed the camera preview with a modified image that would be provided by the OpenCV plugin ?
@TheCodingNotebook Жыл бұрын
I believe the camera preview is using the native Android/ios preview layer. For example on Android it is probably some sort of GLRenderer. So if you want to change the preview you'll have to do it natively, and in the case of Android and a GLRenderer you won't be able to use OpenCV. Maybe you dont have to use a preview layer and just use an Image widget and change the image on new frame, on a fast cpu phone it might work, but I would not take it to production..
@asilepolitiqueasilepolitiq6943 Жыл бұрын
@@TheCodingNotebook Thanks for your answer ! Yes I was thinking about rendering the image flow as an OpenGL texture in a widget... there must be a solution... I'll check what can be done with the Flutter AR kit plugins too...
@iamcaominhtien Жыл бұрын
How to reduce the capacity of the app apk? (~312MB :<) (Debug is ~ 416 MB)
@TheCodingNotebook Жыл бұрын
I never looked into it in a Flutter app so I can't tell. Basically you would want to split ABIs per cpu architecture
@andreramos3290 Жыл бұрын
top
@TheCodingNotebook Жыл бұрын
thx
@rahulravindra4418 Жыл бұрын
Hello thanks a lot for the tutorial. Could you direct me to an example for tensorflow lite where it is purely run on C and not C++ ? Thank you
@TheCodingNotebook Жыл бұрын
I don't know of any...
@luisantonio1934 Жыл бұрын
First of all, congratulations for the amazing video! it helped a lot! I have a doubt.... I'm not using the camera stream, instead I'm using takePicture() which saves my image to a file. If I convert this file to type Uint8List, will the detector work?
@TheCodingNotebook Жыл бұрын
It should work with any byte array that represent an image...
@Rohit-fr2ky Жыл бұрын
i have a small doubt i guess in the detect function of native_opencv.cpp file there is a code like follows Mat frame; if (isYUV) { Mat myyuv(height + height / 2, width, CV_8UC1, bytes); cvtColor(myyuv, frame, COLOR_YUV2BGRA_NV21); } else { frame = Mat(height, width, CV_8UC4, bytes); } what my doubt is that when it is in YUV format why we have to set height to ```height + height / 2``` to convert it to a Mat datatype ?
@TheCodingNotebook Жыл бұрын
This represents the amount of bytes in the YUV format. If I remember correctly this implementation was taken from the opencv for Android
@lukasmertens4996 Жыл бұрын
how do you get that terminal window? Also, I don't get the second android folder when opening the android project under example in android studio. How do i fix this?
@TheCodingNotebook Жыл бұрын
Not sure I follow
@lukasmertens4996 Жыл бұрын
@@TheCodingNotebook with terminal i mean the terminal you used to create the arucodetector files and folder etc in the ios classes folder in the opencv section(4:20) of the video. With android folder i mean that the android project under example in the android studio section isn't showing the android project of the flutter opencv plugin project folder itself, so i only see the one under example when loaded into android studio(i can't see the plugin code in the project)(6:30)
@lukasmertens4996 Жыл бұрын
@@TheCodingNotebook ok so i got it to work but only when i downloaded your git project and used your create command on it and after some changing of kotlin and gradle versions. I don't know what causes it to not work when i follow the tutorial from scratch. I think it has something to do with the flutter create command but i don't know what
@lukasmertens4996 Жыл бұрын
@@TheCodingNotebook i found the solution, the flutter create command you use doesnt create the NativeOpencvPlugin.h and NativeOpencvPlugin.m files for me, so i had to create them manually
@TheCodingNotebook Жыл бұрын
Good luck!
@amiltonrogeriodasilva1655 Жыл бұрын
The current models available on the tflite-cross platform demo (mobilenet v1.tflite and M-LSD_320_tiny_fp16.tflite) are returning that error: Detection model input should be kTfLiteFloat32!
@TheCodingNotebook Жыл бұрын
Try to debug and see why exactly, maybe the "quantized" parameter passed to the detector does not match the model (like if the model input is indeed float32 but the detector was initialized with quantized=true)
@Rohit-fr2ky Жыл бұрын
you are a lifesaver man. thanks a lot :)
@TheCodingNotebook Жыл бұрын
Glad it helped
@ahmadooof Жыл бұрын
That's super
@TheCodingNotebook Жыл бұрын
Thx!
@muhammadjunaid5166 Жыл бұрын
Thanks for the wonderful explanation
@TheCodingNotebook Жыл бұрын
You are welcome!
@laurick1993 Жыл бұрын
Is it possible to create a 32bit tensorflow librairy?
@TheCodingNotebook Жыл бұрын
Not that I know.
@icebakbum Жыл бұрын
Thank you! This is great work! I just heard about ffi before, and after listening to your explanation, I think nothing is impossible. Thank you so much,
@TheCodingNotebook Жыл бұрын
Indeed! integrating c++ into you flutter app opens a lot of possibilities. good luck!
@OmprakashKesharwani-wx6rt Жыл бұрын
How to get msys terminal in windows and I am not able to get files under cpp folder in android studio.
@TheCodingNotebook Жыл бұрын
Make sure all paths are correct in the CMakeLists file. I'm not familiar with msys
@OmprakashKesharwani-wx6rt Жыл бұрын
@@TheCodingNotebook I cloned that app from github and there were already exist arucodetecor.cpp and arucodetector.h file
@TheCodingNotebook Жыл бұрын
First make sure you opened the correct project "native_opencv/example/android", then sometimes choosing "File->Sync Prject with Gradle files" can help... other than that I don't have any further ideas....
@sonatuzun7020 Жыл бұрын
It is fun to watch someone so familiar with the tools they are using :) Thanks for the tutorial
@TheCodingNotebook Жыл бұрын
You're very welcome!
@aethersx2 Жыл бұрын
Can you make face recognition? like auth account is same or not, please make in dart or flutter project with open cv
@TheCodingNotebook Жыл бұрын
You can try, I showed the basic integration of opencv and flutter now you can try and do whatever with opencv
@aethersx2 Жыл бұрын
@@TheCodingNotebook can opencv run on serverside? I want to try in the dart language using a shared library single open cv is it possible? sorry I'm very new to opencv
@TheCodingNotebook Жыл бұрын
Yes it can run on the server
@michaelchiew8473 Жыл бұрын
Can this project able to help to measure other item measurement by using the aruco marker as reference size?
@TheCodingNotebook Жыл бұрын
Theoretically yes, never done this. But if you know the marker size you can measure the distance between 2 points in "marker units" and then convert to real size (as longs as the points are on the same surface as the marker). But again, never tried to implement something like that. Obviously on mobile you would want to go with arkit/arcore
@scoobyisadog Жыл бұрын
Hi have you tried Flet? I have a pose estimation code I want to turn into an app and am deciding whether to try Flutter or Flet. Any thoughts?
@TheCodingNotebook Жыл бұрын
No, haven't heard of it...
@uDubRiceBoy Жыл бұрын
how do you install bazel?
@TheCodingNotebook Жыл бұрын
Check their docs: bazel.build/install/windows Usually I just download the binary from their GitHub repo
@giacozanna96 Жыл бұрын
Thank you very much! Really interesting and useful video
@TheCodingNotebook Жыл бұрын
Glad you enjoyed it!
@fiyazkhan6460 Жыл бұрын
nice. could you please share the code link
@TheCodingNotebook Жыл бұрын
It's on the video description
@asdfasdfasdf3832 жыл бұрын
My brain is now fried, I like it. This is Gold. Your explanation is excellelt, I learned quite a lot.
@TheCodingNotebook2 жыл бұрын
Haha, yes, it's a heavy topic, happy you liked it
@faris74492 жыл бұрын
thanks, i appreciate your work mate
@TheCodingNotebook2 жыл бұрын
thx!
@HS_COMET2 жыл бұрын
Nice video
@TheCodingNotebook2 жыл бұрын
Happy you liked it!
@bennguyen13132 жыл бұрын
How would this change if targeting Windows? Or in general, using ffi/ffigen to access peripherals connected to the desktop (usb, bluetooth, etc )? For example, I have both 32-bit and 64-bit dlls that can access different hardware.. can flutter build/link with those dlls, and more importantly work when the dll functions are called? Any tips on 'Integrating C library in a desktop Flutter app using Dart FFI'?
@TheCodingNotebook2 жыл бұрын
Never tried...
@NickTaSpy2 жыл бұрын
Thank you for helping me setup flutter with opencv. I was struggling a lot to figure it out but it's also my first day using flutter 😅
@TheCodingNotebook2 жыл бұрын
Glad it helped!
@moataz24152 жыл бұрын
#include <opencv2/core/core.hpp> not found even after build the project😒
@TheCodingNotebook2 жыл бұрын
Check the gradle output when doing "gradle sync", sometimes "find_package(OpenCV REQUIRED)" will error and the error message can be easily overlooked
@abdullahilyas49782 жыл бұрын
Thanks alot your video helped alot. How can I get that cropped image of detected object and give it to another model? Thanks in advance!
@TheCodingNotebook2 жыл бұрын
The object detection model will give you the coordinates of the detected object, then you will have to crop it somehow... In order to get the coordinates you can take a look at the sample code ObjectDetection.kt function drawDetection