Build an Android app to recognize flowers

  Рет қаралды 50,884

Android Developers

Android Developers

Күн бұрын

Khanh shows you how to train a TensorFlow Lite model that can recognize custom images with your own dataset using TensorFlow Lite Model Maker. Then, Hoi shows you how to integrate the model into an Android app using the new ML Model Binding plugin in Android Studio 4.1 beta.
Resources:
Codelab which goes through all the steps in this screencast → goo.gle/TFCodeLab
Android Studio 4.1 beta download → goo.gle/AS41
TensorFlow Model Maker → goo.gle/TFLMaker
Check out the 11 Weeks of Android website → goo.gle/30FDT8S
Related Playlists:
Machine Learning - 11 Weeks of Android playlist → goo.gle/ml-11w...
11 Weeks of Android playlist → goo.gle/androi...
Subscribe to Android Developers → goo.gle/Androi...
Speakers:
Khanh LeViet, Hoi Lam
#featured #android11 #11WeeksOfAndroid

Пікірлер: 72
@bdmaxvalera
@bdmaxvalera 4 жыл бұрын
Android + Tensorflow 2.0 = ❤️
@cerpenai1
@cerpenai1 2 жыл бұрын
my cnn tensorflow lite model has no metadata how do I convert cnn keras model to tensorflow lite model which contains metadata?
@BagusSulistyo
@BagusSulistyo Жыл бұрын
thanks Khanh , I really love this course/ video
@aiders4352
@aiders4352 3 жыл бұрын
I'm 6 months late to this, seems the colab is broken. Getting the same error every time at the "import the required packages" step. The error is ModuleNotFoundError: No module named 'tflite_support'
@moufditaha8779
@moufditaha8779 3 жыл бұрын
same for me have you figured out a solution for this please ?
@amirayasmine8490
@amirayasmine8490 3 жыл бұрын
me too
@naufalilhamhw
@naufalilhamhw 3 жыл бұрын
I had the same problem but it could be solved thorough " pip install tflite_support ". Hope this would help!
@JohnSmith-ns3es
@JohnSmith-ns3es 4 жыл бұрын
Great, now can we get another video for face recognition?
@5minutetech841
@5minutetech841 3 жыл бұрын
This is awesome. Just what I needed for my project thank you guys
@chiragmittal996
@chiragmittal996 4 жыл бұрын
Meanwhile, IOS: "Look, I got a new wallpaper!"
@otoS97
@otoS97 3 жыл бұрын
lamao
@Maniclout
@Maniclout 3 жыл бұрын
What if I have an h5 file model. Can I also import it like this? Edit nevermind you can just convert the h5 file to a tflite file
@Alexis-ho3vm
@Alexis-ho3vm 3 жыл бұрын
Hello, very good video ..... but I have a query .... you can output a confusion matrix to the tensorflow lite model
@fauzisafina1827
@fauzisafina1827 4 жыл бұрын
Sir.. when i run this in colab i get this error : No module named 'tensorflow_examples.lite.model_maker.core.task.metadata_writers'
@snehitvaddi
@snehitvaddi 3 жыл бұрын
Hey!! Why can't you provide a direct link to the Colab notebook...
@facttv4405
@facttv4405 3 жыл бұрын
good job Sir, stay blessed.
@saibalaji4713
@saibalaji4713 4 жыл бұрын
Hello is it necessary to be expert in ML and DL to start Learning and using Tensor Flow
@sciencetub
@sciencetub 4 жыл бұрын
"ValueError: The size of the train_data (13) couldn't be smaller than batch_size (32). To solve this problem, set the batch_size smaller or increase the size of the train_data." This error comes when I train my custom model.
@mirzamunib5964
@mirzamunib5964 4 жыл бұрын
Thank you Sir great explanation. Sir can you tell me how to import an image and then let tensorflow lite recognize it?
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
Do you mean recognize an image that is on phone's image gallery? Just load the image to a Bitmap instance, then feed it to the TFLite model as demonstrated in the video. devofandroid.blogspot.com/2018/09/pick-image-from-gallery-android-studio_15.html
@mirzamunib5964
@mirzamunib5964 4 жыл бұрын
@@khanhleviet5416 Thank you sir for helping.
@zairi36
@zairi36 3 жыл бұрын
@@mirzamunib5964 Did you manage to make it work? I actuallay tried but faced many issues that I can not solve. If you find something interesting on how to make it work with an image from the gallery
@guillermorayabatanero6623
@guillermorayabatanero6623 4 жыл бұрын
Great! And if I want to recognize a specific speech of a human voice I can do also?
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
Please check out the Android's speech regconizer developer.android.com/training/wearables/apps/voice#FreeFormSpeech
@shadmanadman5222
@shadmanadman5222 3 жыл бұрын
thanks. saved my day
@arnabkundu9410
@arnabkundu9410 3 жыл бұрын
Hi Khanh LeViet, Hoi Lam Could you please mention the repo branch and commit tag when you exactly recorded this video. So that I can follow along with the this demo. I found lots of daily basis commits in master branch. So getting confused you know. Thanks in advance.
@niteshverma2310
@niteshverma2310 3 жыл бұрын
Wow. The video I was looking for.
@vigneshjothilingam7624
@vigneshjothilingam7624 4 жыл бұрын
after importing the TFLClassify-main in the android studio... I can't able to run the project .. Why is that!? i'm not using the android studio beta version, is that make sense!?
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
It requires Android Studio 4.1, which was in Beta channel at the time of this post.
@niteshverma2310
@niteshverma2310 3 жыл бұрын
I am trying to build another app from tensorflow lite object detection android example. Need your guidance.
@deepanshudutta4443
@deepanshudutta4443 3 жыл бұрын
Sir I can't use 4.2 Beta 4.I download that but there is a folder called android studio,sir where I need to paste that foldar to work properly.One thing I have android studio.
@dawoodamir2011
@dawoodamir2011 4 жыл бұрын
This is just awesome.
@stifenjans4342
@stifenjans4342 3 жыл бұрын
wish me success to learn it, amen, and a whole comentary below
@DinanathLad
@DinanathLad 2 жыл бұрын
Whats in TFL Classsify? I only have .tflite file with me from Vertex AI.
@atharvapuranik5342
@atharvapuranik5342 4 жыл бұрын
Sir can you help me?? Can a app developer reach to our gallery and media files stored in our phone (private photos and videos) if we had given him a storage permission? Even if we don't upload photos and videos on his app ?? Plz answer me? 😔
@kothamasusairahul879
@kothamasusairahul879 4 жыл бұрын
Where I can download the TFL Classify folder?
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
You can follow this instruction: codelabs.developers.google.com/codelabs/recognize-flowers-with-tensorflow-on-android-beta/#2
@eyeopener2434
@eyeopener2434 4 жыл бұрын
Goodday .So if im using different image data set with more images its giving me an error on traing mentioning about Value Error : image size is zero
@phadu1024
@phadu1024 3 жыл бұрын
Same here
@chiragpatankar2013
@chiragpatankar2013 2 жыл бұрын
did u find the solution?
@atomtrevor9958
@atomtrevor9958 3 жыл бұрын
Thanks for your tutorial. I tried to incorporate it on my Android project; unfortunately, I have a problem with "RecognitionAdapter.kt". Specifically, the error regarding these lines: import org.TensorFlow.lite.examples.classification.databinding.RecognitionItemBinding import org.tensorflow.lite.examples.classification.viewmodel.Recognition I don't get the same java (generated) files. May you please help me to solve this problem? Thank you in advance.
@simonium0
@simonium0 3 жыл бұрын
Does that work for a Flutter app as well?
@mirzamunib5964
@mirzamunib5964 4 жыл бұрын
Sir, i put the model i trained on 2 species in the start and at Model it says "no metadata found in this model" . The sample code of my model is shown. help pls
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
Do you use Model Maker to train the model as in this Colab notebook. tensorflow.page.link/tflite-img-classifier The error indicates that the TF Lite model doesn't have the metadata needed for Android Studio to parse it. Therefore, I suspect that you train the model without using Model Maker hence the metadata is missing. If you want to add metadata manually, you can check out this guide. www.tensorflow.org/lite/convert/metadata
@mirzamunib5964
@mirzamunib5964 4 жыл бұрын
@@khanhleviet5416 Sir i trained my model on my computer on anaconda jupyter. Sir what should i do now is there any way i can do it without metadata or its is necessary for this technique?
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
@@mirzamunib5964 TF Lite Model Maker can run on your local jupyter notebook as well. Just follow the step in the notebook I shared above. To integrate the TF Lite model using the Android Studio plugin as shown in the video, it must have metadata.
@mirzamunib5964
@mirzamunib5964 4 жыл бұрын
@@khanhleviet5416 Hello Sir sorry for disturbing you again i'm new to this field. Sir, should i again train all the model from scratch for model maker. can you tell me where to get this model maker code?
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
@@mirzamunib5964 Here is the version used in this video tensorflow.page.link/tflite-img-classifier And here is the full documentation of Model Maker for image classificationn www.tensorflow.org/lite/tutorials/model_maker_image_classification
@user-wz5sy1oc6d
@user-wz5sy1oc6d 4 жыл бұрын
I can not start android studio in my computer 🙄🙄
@learner_1228
@learner_1228 3 жыл бұрын
android beta version 4.2 showing tensorflow lite min sdk>=19? how to fix it sir?
@mosin8673
@mosin8673 3 жыл бұрын
While creating new project , When you are selecting the minSDK like jellybean or something like that with multiple options available you see the api level beside name of SDK , select minSDK with api level >=19 then it will work fine
@AlphaZ96
@AlphaZ96 4 жыл бұрын
amazing !
@taschajalani7927
@taschajalani7927 3 жыл бұрын
great video. But how can I do the code in Android Studio if I create a new project ? please help
@vidyalakshmiprabhu7805
@vidyalakshmiprabhu7805 3 жыл бұрын
Hey did u develop in android studio by now?
@vidyalakshmiprabhu7805
@vidyalakshmiprabhu7805 3 жыл бұрын
Hey did u develop in android studio by now?
@TheRandomTecLad
@TheRandomTecLad 3 жыл бұрын
i need help t load my own data and train
@sks-nz6mz
@sks-nz6mz 2 жыл бұрын
me too. have you figured out
@mirzamunib5964
@mirzamunib5964 4 жыл бұрын
Sir when i import my model in the android studio i get this error: "Tried to use preview panel provider (JavaFX WebView), but it is unavailable. Reverting to default."
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
Did you use Android Studio 4.1, which is in beta channel at this time of this post? The project won't work on earlier versions of Android Studio.
@sks-nz6mz
@sks-nz6mz 2 жыл бұрын
@@khanhleviet5416 Hi, at 2:05 you tell we can upload our own images to collab, when i have uploaded a .zip file containing folders of pictures of mushrooms to the collab directory, how to get the http path of that file(and how to unzip it)? to update the cell that by default has the https path to the flower images. Would really appreciate your help
@khanhleviet5416
@khanhleviet5416 2 жыл бұрын
@@sks-nz6mz When you upload a file to Google Colab, It'll be uploaded to the "/content" directory. The path to the file will be something like /content/your_file.zip. Then you'll need to unzip it with this command: "unzip your_file.zip".
@jayeshsrivastava3697
@jayeshsrivastava3697 4 жыл бұрын
I can't import the model on Android Studio 4.1 Beta. Please help.
@hoilam6785
@hoilam6785 4 жыл бұрын
Can you please give us more details? We are monitoring StackOverflow.com - tag your question with Android-Studio AND TensorFlow-Lite.
@abhishekrai2198
@abhishekrai2198 3 жыл бұрын
how to get the Android code i can't find it
@motalshik
@motalshik 4 жыл бұрын
ANDROID TOP!!!!!!!!
@atta2616
@atta2616 4 жыл бұрын
Let me ask: In my video above, I see each folder with the name of a flower associated with that folder of flowers. Like directories: Roses come with lots of rose photos. So, my question is: 1 photo of me has many enlarged photos, what should I do? For example: If a picture of me has many flowers, I have to cut each flower in that picture ??
@khanhleviet5416
@khanhleviet5416 4 жыл бұрын
No you don't need to cut out each flower if all of them belong to the same class (e.g. roses). If a photo contains flowers of multiple classes, it will confuse the ML model. Image size doesn't matter. Model Maker will automatically resize it to fit with the model input size.
@gagang4286
@gagang4286 4 жыл бұрын
that's quite difficult to collect images of thousands of flowers by their categories🙄
@quockhanh6852
@quockhanh6852 4 жыл бұрын
chrome has extensions help you download a whole page of google image search
@idealclassroom6422
@idealclassroom6422 3 жыл бұрын
Use Google open datasets images....follow' the Ai guy' to know more
Bird detection with TensorFlow Hub & ML Kit
18:31
Android Developers
Рет қаралды 18 М.
AI Landmark Recognition With Tensorflow Lite and CameraX on Android
34:28
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 57 МЛН
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 20 МЛН
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 127 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 962 М.
Build a modular Android app architecture (Google I/O'19)
32:21
Android Developers
Рет қаралды 176 М.
Jetpack Compose
24:20
Android Developers
Рет қаралды 66 М.
Android Coroutines: How to manage async tasks in Kotlin
17:49
Android Developers
Рет қаралды 42 М.
MIT Introduction to Deep Learning | 6.S191
1:09:58
Alexander Amini
Рет қаралды 567 М.
Navigating navigation
14:20
Android Developers
Рет қаралды 35 М.
Fragments: Past, present, and future (Android Dev Summit '19)
18:21
Android Developers
Рет қаралды 76 М.
The Ultimate Package Structure Guide for Android Developers
12:10
Philipp Lackner
Рет қаралды 41 М.
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 57 МЛН