Deploy Ml model on android | android project java | android studio | cat dog app

  Рет қаралды 45,036

ProgrammingHut

ProgrammingHut

Күн бұрын

Пікірлер: 94
@aguelejoseph5753
@aguelejoseph5753 Жыл бұрын
YOU DID A REALLY REALLY GREAT JOB. Although i am doing something different and more complex but you have given me the headstart that I need. Thank you soo much.
@paragbharadia2895
@paragbharadia2895 2 жыл бұрын
Sir, at 0:46 which software/ide did you open?
@programming_hut
@programming_hut 2 жыл бұрын
It’s sublime
@Sweety-rx8zq
@Sweety-rx8zq 3 жыл бұрын
Why extension is as .h5? Any help would be appreciated
@gloriamasengo
@gloriamasengo Жыл бұрын
Hi can you show me how to display 5 classes not 2, the model is only showing me for 2
@greenheart3880
@greenheart3880 3 жыл бұрын
explained it in really easy way THANKS 👍
@egamomusu
@egamomusu 2 жыл бұрын
Thank you..however the trained model is not available anymore in the given google drive link at the description section. Could you please upload the model again ? Thank you
@andrearomeroramos6586
@andrearomeroramos6586 Жыл бұрын
Hello!!! Could you pass me the code of your model please, the drive link does not work
@Yussel_UG
@Yussel_UG 3 жыл бұрын
¡Gracias!
@programming_hut
@programming_hut 3 жыл бұрын
Thanks 🙏
@swathinagiri3003
@swathinagiri3003 11 ай бұрын
I have used same program but instead of getting output the application is automatically closing
@arushsingh5489
@arushsingh5489 2 жыл бұрын
Hey! How do I print my predicted label if I don't want to see numerical predictions?
@m.abdullahkamran8805
@m.abdullahkamran8805 2 жыл бұрын
Hey Sir I am getting wrong output from tflite model when I converted it from keras model. Although output is perfectly fine when I use the same input in keras model.
@AtticEdits
@AtticEdits 8 ай бұрын
Me too😢
@yogietrypambudi6187
@yogietrypambudi6187 3 жыл бұрын
wow what a good idea to using tensorflow for deep learning app android. but i"ve question when you click predict show the number accuracy data. it"s accurate?
@programming_hut
@programming_hut 3 жыл бұрын
I don't really understood what you meant. I think you want to show the confidence of prediction right ? btw thanks for your compliments ...
@matovushafik2372
@matovushafik2372 3 жыл бұрын
why is it that my app crashes whenever i click the predict button, anyways, great work, thank you
@jeffr_ac
@jeffr_ac Жыл бұрын
Did It work?
@lavanyal9418
@lavanyal9418 Жыл бұрын
I also have same problem.Did you resolve your problem?If yes please let me know the solution
@islembenamar1355
@islembenamar1355 2 жыл бұрын
how i can see the label for images ??
@muhammadtalha2493
@muhammadtalha2493 3 жыл бұрын
hello sir, when i click the predict button application automatically close will u help ??
@programming_hut
@programming_hut 3 жыл бұрын
what are inputs and outputs, if its image then what is input image size , if possible can you share code
@muhammadtalha2493
@muhammadtalha2493 3 жыл бұрын
@@programming_hut i also train a model on googlecolab with cnn and then convert it in to tflite like the way You told and it happens the same when u clicked the predict button application shytdown
@muhammadtalha2493
@muhammadtalha2493 3 жыл бұрын
image size is (200,200,3)
@muhammadtalha2493
@muhammadtalha2493 3 жыл бұрын
@@programming_hut from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.preprocessing import image from tensorflow.keras.optimizers import RMSprop import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras from keras.models import Sequential from tensorflow.keras import layers from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, Dropout #from keras.utils import to_categorical import numpy as np import os from keras import backend as K import cv2 from google.colab import drive drive.mount('/content/gdrive') cv2.imread("/content/gdrive/MyDrive/checkTest/training/diseased/0a01cc10-3892-4311-9c48-0ac6ab3c7c43___RS_GLSp 9352_270deg.JPG").shape train = ImageDataGenerator(rescale = 1/255) validation = ImageDataGenerator(rescale = 1/255) train_dataset = train.flow_from_directory( '/content/gdrive/MyDrive/checkTest/training', target_size=(200, 200), batch_size=3, class_mode = 'binary') validation_dataset = validation.flow_from_directory( '/content/gdrive/MyDrive/checkTest/validation', target_size=(200, 200), batch_size=3, class_mode = 'binary') train_dataset.class_indices model = tf.keras.models.Sequential([ tf.keras.layers.Conv2D(16,(3,3), activation='relu', input_shape = (200,200,3)), tf.keras.layers.MaxPool2D(2,2), # tf.keras.layers.Conv2D(32, (3,3), activation = 'relu'), tf.keras.layers.MaxPool2D(2,2), # tf.keras.layers.Conv2D(64, (3,3), activation = 'relu'), tf.keras.layers.MaxPool2D(2,2), # tf.keras.layers.Flatten(), # tf.keras.layers.Dense(512, activation = 'relu'), # tf.keras.layers.Dense(1, activation = 'sigmoid') ]) model.compile(loss = 'binary_crossentropy', optimizer = RMSprop(learning_rate = 0.001), metrics = ['accuracy']) model_fit = model.fit(train_dataset, steps_per_epoch = 3, epochs = 50, validation_data = validation_dataset) dir_path = '/content/gdrive/MyDrive/checkTest/testing' for i in os.listdir(dir_path): img = image.load_img(dir_path+'//'+i, target_size= (200,200)) plt.imshow(img) plt.show() X = image.img_to_array(img) X = np.expand_dims(X,axis = 0) images = np.vstack([X]) val = model.predict(images) if val == 0: print ("The leaf has disease") else: print ("The leaf is Healthy")
@programming_hut
@programming_hut 3 жыл бұрын
so did you resized your bitmap accordingly in android studio
@localbus7008
@localbus7008 3 жыл бұрын
Sir i cant find modeltfLite file in your github
@ronixbhaskar8263
@ronixbhaskar8263 2 жыл бұрын
Which software have been used ??
@Jerrod2444
@Jerrod2444 3 жыл бұрын
hi sir, how to get my output result if my result is String ?
@shivamdubey4783
@shivamdubey4783 2 жыл бұрын
sir do we need to learn java for this coz i only know python and tensorflow
@programming_hut
@programming_hut 2 жыл бұрын
Yes basic understanding of java is required
@antapratama4735
@antapratama4735 3 жыл бұрын
How to see name output with labels.txt and %predict?
@m.abdullahkamran8805
@m.abdullahkamran8805 2 жыл бұрын
Sir how to normalize bitmap. My model takes pixel values from 0-1 but in android studio when i save image in bitmap it stores values from 0-255 in bitmap. Kindly tell how to covert bitmap values from 0-1.
@Alex-bx6jf
@Alex-bx6jf 2 жыл бұрын
train the model without normalization or you can add pre-processing layers to the model itself during training
@m.abdullahkamran8805
@m.abdullahkamran8805 2 жыл бұрын
@@Alex-bx6jf It is reducing overall accuracy of the model.
@amirayasmine8490
@amirayasmine8490 3 жыл бұрын
thank you so much that was very helpful
@programming_hut
@programming_hut 3 жыл бұрын
glad you liked it
@Sara-fp1zw
@Sara-fp1zw 2 жыл бұрын
that was nice thankyou!!!
@kirtipatidar261
@kirtipatidar261 2 жыл бұрын
hey can you tell me which linux-distro do you use
@programming_hut
@programming_hut 2 жыл бұрын
Linux mint
@ismail_..
@ismail_.. 2 жыл бұрын
Hello sir,Can I use Kotlin language instead of java in tensorflow lite projects?
@programming_hut
@programming_hut 2 жыл бұрын
Yes
@codewithchando971
@codewithchando971 3 жыл бұрын
How I can Get the Confidence Value of The Prediction? Extra Code that's I need to add?
@programming_hut
@programming_hut 3 жыл бұрын
the outputFeature variable contains the confidence of each class
@AshutoshKumar-yn6wf
@AshutoshKumar-yn6wf 3 жыл бұрын
Hey bro can u tell me how to use full 1000 list of tensorflow in this code
@LAJianoran
@LAJianoran Жыл бұрын
it shuts off when I use my model
@nitesharu1269
@nitesharu1269 3 жыл бұрын
can a pkl file be used in android studio
@saifchowdhury9728
@saifchowdhury9728 3 жыл бұрын
how can I add labels.txt code in this apps?
@localbus7008
@localbus7008 3 жыл бұрын
I can't understand the folders hierarchy..
@__dekana__
@__dekana__ Жыл бұрын
You are the best!!!!
@safalghalegurung425
@safalghalegurung425 3 жыл бұрын
hello sir im having trouble with model having multiple class can you make video on it as well?
@safalghalegurung425
@safalghalegurung425 3 жыл бұрын
there seems to be a video but its in kotlin and i am working on java project.
@programming_hut
@programming_hut 3 жыл бұрын
are you looking for this ----> kzbin.info/www/bejne/bHbVk3mHl52EiZo
@safalghalegurung425
@safalghalegurung425 3 жыл бұрын
@@programming_hut well yes it is but i want it in java and this tutorial is based in kotlin.
@arsalanahmed3488
@arsalanahmed3488 3 жыл бұрын
Can we use a teachable machine file here? using this method?
@programming_hut
@programming_hut 3 жыл бұрын
as far as it is tflite it should work... I never tried but it should work
@arsalanahmed3488
@arsalanahmed3488 3 жыл бұрын
@@programming_hut i trying to use it
@programming_hut
@programming_hut 3 жыл бұрын
@@arsalanahmed3488 so did you got any error
@arsalanahmed3488
@arsalanahmed3488 3 жыл бұрын
@@programming_hut i don't test it yet if it will be successfully run i will inform you
@arsalanahmed3488
@arsalanahmed3488 3 жыл бұрын
@@programming_hut it's working proper but please let me know it's showing the result in number i don't want to show in number
@saipadmasree2048
@saipadmasree2048 3 жыл бұрын
sir how can i create h5 file for my project?
@rhk1991
@rhk1991 3 жыл бұрын
thank you kind sir, i really need this one.
@handhikayp
@handhikayp 3 жыл бұрын
Sir, your drive links seems that you already remove the project into trash, can you renew the link? thanks
@programming_hut
@programming_hut 3 жыл бұрын
I'll see
@tauseefrehman2
@tauseefrehman2 2 жыл бұрын
Is this work for every kind of ML model?
@seymatezcan4058
@seymatezcan4058 3 жыл бұрын
Hello thank you for this video I have a question: How can I create model.tflite file on Jupyter notebook?
@rushidesai2836
@rushidesai2836 3 жыл бұрын
Use Tensorflow with Python
@programming_hut
@programming_hut 3 жыл бұрын
try this kzbin.info/www/bejne/fZaqnXqHbZWgkMk
@deveshreekadu4087
@deveshreekadu4087 3 жыл бұрын
Plz upload TFLite file on github As it is not available on drive
@programming_hut
@programming_hut 3 жыл бұрын
I'll see if i still have it on my laptop
@sarasaleh6751
@sarasaleh6751 3 жыл бұрын
HI ,thank u for the this great video , but i can't upload my model it is bigger than 200 MB , is there is another way of upload or I should paste my model in assets .? thanks
@programming_hut
@programming_hut 3 жыл бұрын
you can use api methods btw what your model do
@sarasaleh6751
@sarasaleh6751 3 жыл бұрын
@@programming_hut thank u , I don’t know how to use api methods .. my model it to recognize images type .. from an image
@programming_hut
@programming_hut 3 жыл бұрын
may be this could help converting ml model to api : kzbin.info/www/bejne/bYXIaKWug5qeaMk how to make api android app : kzbin.info/www/bejne/n6GropyjbM2in9E
@fawniaavissa9711
@fawniaavissa9711 Жыл бұрын
thankyou 8:35
@nishilraiyarela5141
@nishilraiyarela5141 2 жыл бұрын
Thanks it works
@robertgermia5758
@robertgermia5758 3 жыл бұрын
I used my model with leaf images for prediction. It successfully worked when I use leaf image. But it also gives prediction results for any image ex:-pencil. Can you please tell me how to validate only to predict the leaf images? I hope you will reply. Thank you. i think it is in if probability score > threshold value but I didn't have idead how to do it.
@programming_hut
@programming_hut 3 жыл бұрын
when you trained your model you need add one more class called unknown and in that add whatever unknown images you can get . again train it and then try. I hope this could work.
@dwiencabalquinto5545
@dwiencabalquinto5545 2 жыл бұрын
did you solve your problem?
@sivanit3150
@sivanit3150 3 жыл бұрын
The video is too excellent!!!! But I'm getting error while using start activity for result, it says it is deprecated... What should i do now... Any suggestions... Also I'm getting an error as when i click on predict button, the app closes... I'm bit confused as to what would cause this. Thanks for your suggestion in advance!!
@davidcoyle958
@davidcoyle958 3 жыл бұрын
I assume this will work for any tflite model?
@programming_hut
@programming_hut 3 жыл бұрын
yes as far as follow same steps
@davidcoyle958
@davidcoyle958 3 жыл бұрын
@@programming_hut great thank u bro
@sureshxoela7273
@sureshxoela7273 3 жыл бұрын
Thanks
@saquelainmokhtar6016
@saquelainmokhtar6016 3 жыл бұрын
thanks
@ywf98
@ywf98 3 жыл бұрын
thanks
Deploy ml model using flask | heroku | server | ML model to API
11:14
ProgrammingHut
Рет қаралды 4,1 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Deploy ML model in 10 minutes. Explained
12:41
Danil Zherebtsov
Рет қаралды 38 М.
Simple Machine Learning GUI App with Taipy and Tensorflow
30:52
Python Simplified
Рет қаралды 176 М.
Deploy ML models with FastAPI, Docker, and Heroku | Tutorial
18:45
AI Landmark Recognition With Tensorflow Lite and CameraX on Android
34:28
Google’s Quantum Chip: Did We Just Tap Into Parallel Universes?
9:34
How Old Can a File Be?
12:11
Dev Detour
Рет қаралды 76 М.
Chinese app design: weird, but it works. Here's why
10:51
Phoebe Yu
Рет қаралды 586 М.
Object detection using Tensorflow Lite C API on Android
54:16
The Coding Notebook
Рет қаралды 17 М.