A Guide to Running Tensorflow Models on Android

Поділитися
Вставка
  • Опубліковано 19 вер 2024

КОМЕНТАРІ • 295

  • @ryanbennett6801
    @ryanbennett6801 6 років тому +1

    You explain things SO well. I'm about a month into Android development and the commenting on your code has really helped me grasp the concepts I've been coding. Thanks

  • @raffan1
    @raffan1 7 років тому +1

    I remember the days when these videos would be like 10 minute videos and always ran out of breath to catch the hyper active Siraj. But now I can finally take a sigh of relief and learn on my own pace, Thanks, I do appreciate it man.

  • @Intu11110
    @Intu11110 6 років тому +1

    U were the one who introduced me into this wonderful world of machine learning. I'm seriously inspired and have found something part of my life's purpose. I now extremely happy to finally find a detailed video on implementing tensorflow into android

  • @Schmuck
    @Schmuck 7 років тому +68

    I'm really starting to love these videos!! Please never leave youtube siraj
    p.s Thank you for going in detail about android, I haven't really ever touched it. Would have been way more confusing if you skimmed it over.

  • @audhil
    @audhil 7 років тому

    Hi Siraj, I love your videos, I'm an Android developer, You are rock star, you took so much pain to write comments for the project imports too. Wow! Hats off to you!

  • @angelgama5460
    @angelgama5460 5 років тому +2

    I think this is one of the best guides I've ever seen. You have something special!! Thank you, seriously it has been very useful

  • @akshatagrawal1749
    @akshatagrawal1749 6 років тому +3

    Adding " compile 'org.tensorflow:tensorflow-android:+' " to the dependencies section of the gradle file automatically downloaded the AAR file. Thanks Siraj for this awesome tutorial!!

    • @divyanshujhawar3671
      @divyanshujhawar3671 6 років тому

      Can you please tell me, where it gets downloaded. I don't find the aar file anywhere

    • @rohan4748
      @rohan4748 6 років тому

      i have tried that but it does not work

  • @chasegraham246
    @chasegraham246 7 років тому +40

    At 1:14 I reflexively reached out for the mouse. Over fitting is a problem for meat brains too.

  • @SwanandKulkarni2194
    @SwanandKulkarni2194 7 років тому +30

    Siraj dropped a video:
    Pause the video Disable AdBlock Refresh the video Learn & Live.

  • @jaybhavsar5929
    @jaybhavsar5929 7 років тому +11

    This guy.. always keeping it real!
    This is exactly what I have been looking for ever since I started playing with Neural Nets. Thank you Siraj.

  • @isaacho4181
    @isaacho4181 5 років тому

    I love Siraj. His in-depth videos are appreciated.

  • @SagarnilDas
    @SagarnilDas 7 років тому +1

    When you flatten the layer to a vector, you don't have probability values like you said in the video. You apply the softmax function to get that, which you did in the last fully connected layer.

  • @Inncondeath
    @Inncondeath 6 років тому

    Awesome video! This was the first video that had a better paste for me. I've watched several videos that has been uploaded from you, but as a new programmer in this field I felt lost after 15 sec. But instead of getting lost this time, I got excited to start working with ML. Keep it up!

  • @creativedolt
    @creativedolt 7 років тому

    Thanks for the great video. Very useful.
    Note for those who may run into a multi dex error:
    I got the following error:
    "Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lorg/tensorflow/Session$Runner;"
    Apparently the gradle.build had the following line added at the end:
    compile project(':tensorflow')
    Solution:
    just delete that line and the app works fine.

  • @naveencooray2733
    @naveencooray2733 7 років тому +1

    hi siraj! thanks alot for the much needed video. btw, i would like to know few things as im pretty much a noob at ML.
    1. can we use this model to build a speech recognition algorithm?
    2. how to upload this into a server ?
    3. what is the best ANN type to process natural language (what a user speaks) and response accordingly? CNN or RNN
    4. can you clarify how to build the connection between the android app and the tensorflow (which is deployed in a server)
    I would be extremely grateful if you could reply. Thanks for all the videos you have done. and please do more. specially android based ML & NLP. cheers!

  • @ravimaurya2533
    @ravimaurya2533 7 років тому +2

    Exactly Siri is worse as compared to Cortana and Google Assistant :) And the best is Siraj Raval.

  • @brianmcmullen95
    @brianmcmullen95 7 років тому +1

    Nice work keeping the vibe upbeat and informal. So many programming tutorial youtubers are so boring/hard to listen to.

  • @ScarTrakk
    @ScarTrakk 7 років тому +1

    Interesting stuff Siraj! Love how you make this accessible. Great work!

  • @deconvfft
    @deconvfft 7 років тому

    thanks man. I was looking for references everywhere and you made a video for this. Great work

  • @akbaralam8683
    @akbaralam8683 7 років тому +7

    you are the coolest dude in the world .. thank you so much

  • @hurasane3947
    @hurasane3947 7 років тому +1

    damn remember when this channel was at 20k subs . Good job

  • @brianhauk5965
    @brianhauk5965 5 років тому +4

    This guide was published in 2017. Which changes would you make to a 2019 update?

  • @MrZouzan
    @MrZouzan 7 років тому +1

    Sir you have just won a life time subscriber

  • @AndroPluss
    @AndroPluss 7 років тому

    Your videos are interesting becos way you present.. making learning as fun is mantra. that your doing very good job. Good job Siraj Raval..

  • @MrUnique960
    @MrUnique960 7 років тому

    I just published an android app, it's 2:28 AM here and just got in bed. Then I see Siraj talking android and tensors, and now I'm back on my laptop.

  • @Kyzuuh
    @Kyzuuh 7 років тому

    Hey Siraj really great video. I think these are my favorite video style, the 5 minute videos are interesting, but this is the type of video I can actually learn to do something from.

  • @cindychen8961
    @cindychen8961 6 років тому +19

    can you make a introduction or a guide for the tensorflow lite ?

    • @vicnent75
      @vicnent75 5 років тому

      with custom data for image detection (boxes)

  • @ShubhamPatil-ot7hf
    @ShubhamPatil-ot7hf 5 років тому +1

    hey Mr. Siraj , i love ur videos .The current video on how to run tensorflow model on android was awesome but it is quit old in 2019. So can you make new video on this topic like how to run "tensorflow models on android using tensorflow lite(tflite) " Thank you for your hard work :)
    keep making this kind of stuff
    ..your genuine subscriber : )

    • @karthikreddy8495
      @karthikreddy8495 5 років тому

      hi bro. do u know how to use pandas and numpy in android? any links or github repositories u have? pls share if u can

  • @Arty66Click
    @Arty66Click 7 років тому

    I'm gonna be quoting u, Siraj: " You can do anything you dream... With the right amount of computation and training." :D

  • @phliip7362
    @phliip7362 7 років тому +1

    Oh hey dude... Real talk... I think I love u! Thank you for doing these awesome video's!!
    Stay awesome!!
    Xx

  • @oscarfernandofloresgarcia830
    @oscarfernandofloresgarcia830 7 років тому

    This channel is gold! Keep the good work

  • @filoktimonrepoulias9259
    @filoktimonrepoulias9259 6 років тому

    Congratulations for your work Siraj!

  • @ivoriankoua3916
    @ivoriankoua3916 6 років тому

    Sir thanks alot for this even in I haven't right learn Android Developpment or write on code of TenserFlow project but it's really exciting to see you do it and also motivating so THANKS SIR

  • @ayusmittal
    @ayusmittal 7 років тому

    Nice video, with a great explanation. This tutorial will save me hours in my project. Hopefully, i would be able to integrate my CNN with Android app faster. Thanks a lot Siraj for this video..

  • @matt-g-recovers
    @matt-g-recovers 5 років тому +1

    Hey Siraj! I absolutely love your videos and your personality.
    This is the only thing I can find of substance Regarding Android and ML.
    How is that possible?
    The biggest industries in tech, Mobile and AI and they have TONs of uses I imagine but we haven't imagined them yet.
    Please do more about Mobile and AI and maybe an observational video about what we might expect?
    Thanks again my dude!

  • @ChicagoBob123
    @ChicagoBob123 7 років тому

    First thanks for the video. Even though its android its what I have been looking for, for a while.
    A small end to end example that actually returns a value.
    Gentle suggestions when you were explaining the TensorFlowInferenceInterface
    and the create method the names inputname would it be better as PBFileName and imagesize maybe pixelwidth so you can get how its flowing, I say this because by this time I had to go back write down what was passed in and figure it out.
    The Android explanation was necessary. Never touched that code so thanks for that too.
    I love your energy so another BIG thank you.

    • @ravimaurya2533
      @ravimaurya2533 7 років тому

      Hey... I am new to Deep Learning. Can you please tell me that in the python export model. How did he named the input_node_names and output_node_names. My model is different so what changes should I make in those names? I am confused there.

  • @andreasv9472
    @andreasv9472 6 років тому +2

    Damn, you're funny! And informative. And you got yourself a new subscriber! Good vid bro, I was looking around about how to deploy tf models to my phone, I only found videos about deploying it to servers. This vid was nice!
    How about to normal computers? I've only seen people recommending Kubernetes or Docker, but it seems overkill.

  • @Mellowjay
    @Mellowjay 7 років тому +8

    Hey Siraj, how you could differentiate between a real road sign and someone wearing a T-shirt of a road-sign?? What kind of neural net structure will filter out the possibilities?

    • @cameronfraser4136
      @cameronfraser4136 7 років тому +4

      For a problem like this the network structure would not be as important as the dataset you trained it on. You would want a dataset that consists of two classes. Class 1) People wearing road sign t-shirts (and other sorts of fake road signs) and Class 2) Genuine road signs. As for architecture, most of the common generic CNN architectures would work well (i.e. inception, alexnet etc).

    • @Gavy093
      @Gavy093 5 років тому

      Its liveliness detection problem, but i'm sure you would have figured that out by now

  • @SnoreKiller1
    @SnoreKiller1 6 років тому

    I just love your channel. Every time I find something new on about ML and want to see a video about it, you have it. Thanks a lot!!!!

  • @AlktrazONE
    @AlktrazONE 6 років тому

    Dude, great job, seriously man keep up the good work.

  • @ladjiab
    @ladjiab 6 років тому

    Will soon be 1 year since uploaded but still worth watching. Thanks Siraj

  • @kedarpednekar7896
    @kedarpednekar7896 5 років тому +1

    Hey Siraj, do you have a video on real time object detection for Android application using tensor flow?

  • @ego_sum_liberi
    @ego_sum_liberi 7 років тому

    Thank you Siraj, Great videos...you are the best!!!!

  • @wasgeht2409
    @wasgeht2409 6 років тому +1

    First of all it is amazing, thank u :D Second , i copy the code from GitHub and test it on my smartphone but the results are very bad , i don't know why

  • @RaviPrakash-dz9fm
    @RaviPrakash-dz9fm 6 років тому

    The most import video for me , given that i am an android developer

  • @ravimaurya2533
    @ravimaurya2533 7 років тому +2

    I still didn't understood how will the Android code put the input(i.e. the pixels list) in the .pb model. Like you added these lines :
    tfHelper.feed(inputName, pixels, 1, inputSize, inputSize, 1);
    //probabilities
    if (feedKeepProb) {
    tfHelper.feed("keep_prob", new float[] { 1 });
    }
    //get the possible outputs
    tfHelper.run(outputNames);
    //get the output
    tfHelper.fetch(outputName, output);
    -- So what parameters was it expecting for... and then how this is passed to the model inside the pb.... its really magical. Please help me :) Thanks in advance. BTW I am a android developer first and then a Python dev.

  • @kryptoshi4706
    @kryptoshi4706 7 років тому

    Hey Siraj! Love your videos man, you are the best! Since now iOS 11 has CoreML waiting for similar tutorial for iOS!!

    • @SirajRaval
      @SirajRaval  7 років тому +1

      thanks! yes yes i need to for sure.

  • @samuel_6572
    @samuel_6572 6 років тому

    Thanks for the awesome tutorial. I'm really looking forward for a android tutorial "how to use tensorflow image recognition with pictures from your gallery" Would be awesome if you could do one

    • @samuel_6572
      @samuel_6572 6 років тому

      Thanks to good explained tutorial on mindorks, I was able to implement it myself. If anyone has question, message me:)

  • @shimlaDnB
    @shimlaDnB 7 років тому

    wow nice! a full detail video :D thanks siraj

  • @draakisback
    @draakisback 7 років тому

    I understand the concept here and I have done quite a lot of android development in the past. I built my own version of this using kotlin (I also expanded the model to alpha chars).
    I was unable, however, to get the build to open on any of devices both virtual or physical. I had to go back and look at the original source code from the video you played at the beginning and then build all of the tensor-flow stuff from scratch myself to get it to work.
    After I did that, I cloned your repository and built your source code but again I ran into the same exact problems that I had myself with my own codebase. Even after fiddling around with various tensorflow AAR/JAR files it didn't seem to want to work for me.
    I feel like your instructions are either missing a step or perhaps I am just not reading them correctly; either way the source code doesn't seem to want to build on my computer. Ill do a little more debugging and see if I can find a specific cause (that way if it is on your end you can fix your code and if it is on mine, then I can learn from it). I did consider the fact that I am building on a windows machine where as you are building on a mac, but usually that's not an issue with android or java.
    Regardless, good video. I've been really wanting to add some of my AI models to the mobile apps that I build, but I've had to do it with Bazel mostly or through using web-servers. Its much easier to be able to just train a model and then preload it into an app then have to setup a server that hosts the information and does the computations.

  • @SunnyFly100
    @SunnyFly100 7 років тому +2

    Siraj, would you please create a video on running Tensorflow on raspberry pi 3. Thank you so much! Love your videos!

  • @razi_official
    @razi_official 6 років тому

    Actually I am working on a project "Plant Disease Detection " that has two parts:
    A website developed in PHP to input image
    An image classification module which is created by using the Tensor flow
    Both modules are working fine individually, I want to know how can I integrate them in a single application (Website) to get the required results.
    The python module uses tensor flow. Any help regarding the issue will be greatly appreciated.Please tell me how can I deploy this module in php based Website?Must reply me Sir

  • @wnjl
    @wnjl 3 роки тому

    This is a great video. I just would echo another comment...what would anyone recommend for someone wanting to use a Keras API with Android in December 2020? Is Firebase an option?

  • @guitarheroprince123
    @guitarheroprince123 7 років тому

    hey Siraj, can you dedicate a video to all the dimensional dependencies we have to take care of to deal with inputs. I'm doing recurrent nns but the input dimensions really confuses me. How about a small video dedicated to that?

  • @sri123098
    @sri123098 6 років тому +4

    Could you please make video on conversion of graph(trained model) to lighter version user tensor flow lite, bazel and TOCO api ?

    • @blakelombard7379
      @blakelombard7379 5 років тому

      www.tensorflow.org/lite/devguide well here is this

    • @ngochieuthai5436
      @ngochieuthai5436 5 років тому

      Here's the instruction
      codelabs.developers.google.com/codelabs/tensorflow-for-poets-2-tflite/#6
      If you have problem converting the model, this may help:
      stackoverflow.com/questions/51374273/importerror-no-module-named-tensorflow-contrib-lite-python-tflite-convert/54742492#54742492

  • @veereshhr1688
    @veereshhr1688 7 років тому

    great work Siraj keep up the good work

  • @kedarpednekar7896
    @kedarpednekar7896 5 років тому

    Hey @siraj, it would be great if you make a tutorial on how to make specific object detection Android app based on tensor flow because many guys need it.

  • @stevemuland8685
    @stevemuland8685 6 років тому

    please, can you do series of how to actually developed android app with tensorflow because here you just speak but showing exactly what you have to do. for a beginer like me, you have lost me already from the beginning

  • @chainesanbuenaventura2874
    @chainesanbuenaventura2874 6 років тому +1

    @Siraj Raval does the optimize_for_inference library still work?

  • @Omar-dk3ei
    @Omar-dk3ei 7 років тому

    You rock Siraj! Thank you

  • @yagamilaitoo6232
    @yagamilaitoo6232 5 років тому

    How to determine what is input and output names ? they always give error as not in the graph.

  • @shivamkumar-qp1jm
    @shivamkumar-qp1jm 4 роки тому

    We can also use api to develop AI app on Android we can integrate with web app api like django rest framework

  • @belaltaher6492
    @belaltaher6492 7 років тому

    can you go a little more in depth on how to download and set the dependencies? You just kinda said "that's it right there" but I wasn't sure what you were talking about.

  • @hrithikraj4277
    @hrithikraj4277 5 років тому +1

    can we use keras as framework on android studio..if yes then how?

  • @luisgerardocholoquingacoch4025
    @luisgerardocholoquingacoch4025 5 років тому

    Excellent video. A question is there the possibility to create my own detection of objects with convolutional neural networks some documentation?

  • @robertlam88
    @robertlam88 6 років тому

    Great effort. Learned so much....... thanks

  • @spiritualpilgrimageYT
    @spiritualpilgrimageYT 4 роки тому +1

    Where is jupyternotebook ?

  • @ajinkyagawali6442
    @ajinkyagawali6442 7 років тому

    I am sorry I am just a beginner in ML but around @25:15 you mention that you used keras and tf both classifiers, but in your keras videos you said that keras uses tf in background. I do not understand how the classifiers will show different outputs. Thank you.

  • @omkarmankar8643
    @omkarmankar8643 4 роки тому

    Best tutorial sir

  • @spdx1
    @spdx1 5 років тому +5

    42:32 - evidence of overfitting

  • @ravimaurya2533
    @ravimaurya2533 7 років тому +1

    Hey Siraj.... one question. How did you named your Input_node_names and output_node_names. My model is different and I want to export it. So what changes should I do in those names? Please help me out someone.

  • @Skythedragon
    @Skythedragon 7 років тому +1

    Could you do a similar tutorial for keras?
    Great video by the way!

  • @omkarwhaval73
    @omkarwhaval73 4 роки тому

    Hello sir can you create a one more video on the object detection
    please.....?

  • @kumarprateek1279
    @kumarprateek1279 5 років тому

    Good tutorials man really helped me alot to deploy mine..

  • @timothydillan4062
    @timothydillan4062 6 років тому

    Hey Siraj! Really Great VIDEOS!!! Can I suggest another video? like making a plant classification app with TensorFlow or the ML Kit from Firebase?

    • @timothydillan4062
      @timothydillan4062 6 років тому

      y'know like identifying plant species and details

  • @janhvivora8498
    @janhvivora8498 3 роки тому

    I have to do a regression prediction for different users using the app. The data will come from App sqlite. Regression model will be different for different users. How do I do that?

  • @anilvutube1
    @anilvutube1 6 років тому

    Thanks for video Siraj, very informative. Do you have a similar video on how to use a .h5 Keras model in an android app

  • @michaelyadchuk4989
    @michaelyadchuk4989 7 років тому +2

    Why was there no livestream?

  • @janhvivora8498
    @janhvivora8498 3 роки тому

    Do you have video where the training happens on the mobile coz the data will keep updating after every user use?

  • @haritm8862
    @haritm8862 6 років тому

    Please help me answer this question, this is my model in Keras:
    model = Sequential()
    model.add(Dense(784, input_dim=784, kernel_initializer='normal', activation='relu'))
    model.add(Dense(10, kernel_initializer='normal', activation='softmax'))
    model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
    So what value should I put in the "input_node_names" and "output_node_name" variables in the "export_model" function? (file mnist_convnet_keras.py)

  • @ankurpatel1809
    @ankurpatel1809 4 роки тому

    How do you add the AAR file? when it says find your file, im confused which file is that?
    Please Help!!

  • @chenqifeng22
    @chenqifeng22 7 років тому +4

    I would recommend to also post on steemit. You will get paid when people upvote your posts.

  • @bbyungbbyungnam351
    @bbyungbbyungnam351 5 років тому

    im subscribing all my youtube account to you hahaha. this was a great video, thanks a lot!!!

  • @hzqhassan
    @hzqhassan 7 років тому

    Always the hero Siraj

  • @ravimaurya2533
    @ravimaurya2533 7 років тому

    Hey Siraj... what if the image is not grayscale but a colorful... RGB image. Then what changes to make?

  • @adohreemas
    @adohreemas 6 років тому

    The python training code had a few steps of preprocessing (like converting to grayscale etc) those steps are not in the Android app. How is preprocessing handled in Android studio ?

  • @govardhanaj9983
    @govardhanaj9983 4 роки тому

    How to detect image label after capturing the pic

  • @rohan4748
    @rohan4748 6 років тому

    How do you train the model ?? great video.

  • @nsudhanva
    @nsudhanva 7 років тому

    This is awesome. Thanks for this. Also, is it possible to train data on mobile phones? Are they powerful enough?

    • @streaper1
      @streaper1 7 років тому +1

      Sudhanva Narayana you can, but will be very, very slow

  • @mukundmagdum4897
    @mukundmagdum4897 7 років тому

    hello Sir...How to use machine learning in business and what are the products

  • @yasirraza8930
    @yasirraza8930 6 років тому

    Great tutorial... Can you please tell me how to recognize sign languages in android?

  • @innotech4079
    @innotech4079 4 роки тому

    Hi did you used TFlite or TF? and did you used JAVA?

  • @usmanali-jh4qe
    @usmanali-jh4qe 4 роки тому

    Hi .... bro Kia hm tenser flow ko use krtey hoye ek android base disease prediction application bna sktey he Kia? Can u help in this kindly it's urgent

  • @Websk00l
    @Websk00l 6 років тому

    how can i change that image detector to a image capture and predicting the image ?

  • @md.shopon2223
    @md.shopon2223 7 років тому

    Hey Siraj, I have trained a model of Handwritten characters in Bangla of 60 Label. I have trained them and then exported the .pb file in android. But I am continuously getting Error initializing classifiers!

  • @acebookwisdom
    @acebookwisdom 3 роки тому

    Is sign language recognition a multi class classification?

  • @hoovie3000
    @hoovie3000 5 років тому

    To export to a .pb model, is input_node_names always equal to ["conv2d_1_input"] regardless of how many layers you have? Is output_node_name always equal to the number of Dense layers plus the output activation function that was used?

  • @MrDominosify
    @MrDominosify 7 років тому

    Hey, is it possible to create a classifier that would interpret my smart wrist band's accelerometer sensor data when I am swimming, and tell me how many lengths, and what styles I had been swimming?
    How do I change simple 3-axis measurements so it can be interpreted, and tell a network, that this time I had been swimming one style?

  • @reddytocode
    @reddytocode 5 років тому +1

    does someone know how can I convert an image .jpg, .png or similar to the vector of float[] that the model need for identify the number?

  • @AkashMishra23
    @AkashMishra23 7 років тому

    This is Awesome, But how is the Compatibility across different hardware, Smartphones have GPU's too.....

    • @streaper1
      @streaper1 7 років тому

      Akash Mishra its cpu only

    • @AkashMishra23
      @AkashMishra23 7 років тому

      but we need to make it GPU compatible soon enough...