Realtime Object Detection Android App | Kotlin | Camera2 api | tflite

Sdílet
Vložit
  • čas přidán 30. 12. 2022
  • Hi in this video you will learn to build an android app which can detect object and draw rectangle around it in real time.
    We will use Camera2 api to read frames from camera and will use tflite tensor flow lite to detect for objects in the frame and finally canvas to draw the rectangle on the frame.
    Hope you will learn something new today.
    After this video you will know:
    1 - How to use Camera2 api
    2 - How to preview the processed frame
    3 - How to deploy tensor flow lite model
    4 - How to setup TextureView
    This is a computer vision android app which is built by using kotlin.
    model link : www.tensorflow.org/lite/examp...
    labels.txt : gist.github.com/Pawandeep-pro...
    code: github.com/Pawandeep-prog/rea...
    contact me :
    facebook : / proogramminghub
    twitter : / programming_hut
    github : github.com/Pawandeep-prog
    discord : / discord
    linkedin : / programminghut
    youtube : / programminghutofficial
    android studio,kotlin,computer vision,tensor flow lite,object detection,realtime,camera2 api,texture view,surface texture,bitmap,canvas,draw rect,mobile net,tflite

Komentáře • 76

  • @ssrpic
    @ssrpic Před rokem

    Thank a lot brother. The project absolutely works!

  • @gustavomartins1247
    @gustavomartins1247 Před rokem +1

    I have been trying to work with flutter packages for quite a while now with no success, I tried modifying my code on kotlin side following your video and it worked, thanks a lot!

  • @mohomedashfak5514
    @mohomedashfak5514 Před rokem

    thanks for the video. it really helped me ❤️❤️

  • @MrAzzu41
    @MrAzzu41 Před rokem

    Thanks sir successfully completed this course and add it to protfolio

  • @AkshayS-us4jq
    @AkshayS-us4jq Před měsícem +1

    THANK YOU SOO MUCH BRO ,THIS HELPED ME A LOT, LOVE YEW LOTS.......

    • @glennimmanuel9338
      @glennimmanuel9338 Před měsícem

      is it work for you? cause in my app it cannot detected the object

  • @MFA_Movies1
    @MFA_Movies1 Před 8 měsíci

    Het brother that a really nice turtorial but i want to know which model you have used for object detection.

  • @yashkhopkar3126
    @yashkhopkar3126 Před rokem +5

    Bro can you make a seperate video on object detection with java full video step by step

  • @vijaygarg8034
    @vijaygarg8034 Před rokem

    "Nice video! Could you please guide me on how to save images to the gallery and perform predictions on real-time camera input and still images?"

  • @davizpoh
    @davizpoh Před rokem

    super thanks...

  • @4ia10_muhammadriyan6
    @4ia10_muhammadriyan6 Před rokem +4

    can you give an example for the yolov8 model?

  • @sainathingle
    @sainathingle Před rokem +2

    can you make tutorial for object recognization or detection for image using cloud api like google vision or any other api

  • @wmusicstudio945
    @wmusicstudio945 Před měsícem

    thank you sir

  • @alanood9500
    @alanood9500 Před rokem

    I have a question about YAMNet TensorFlow lite model (Android app). I want to use it with an audio clip as input, Not a live recording. Can you help in that? Thank you for your help

  • @marianstoikov8218
    @marianstoikov8218 Před 11 měsíci

    Can you do it on Java am new to your channel love your videos really good understanding

  • @puranjitsingh1782
    @puranjitsingh1782 Před rokem

    Great video, also can you let me know how can we generate the tot number of detections as an output from the model (generating results for predictions of different classes)

  • @dargotime6609
    @dargotime6609 Před 9 měsíci

    nice, can we detect objects and record them in video?

  • @mikebledig7208
    @mikebledig7208 Před 3 měsíci

    Is it possible for you to modify the code of this app to use voice output to speak the object the cam sees? Could you show us how we would go about doing that using tts (text to speech)

  • @yokijatiperkasa861
    @yokijatiperkasa861 Před 2 dny

    thanks sir

  • @frankieyeung7064
    @frankieyeung7064 Před 7 měsíci

    great video, but how to fix the textureview aspect ratio deform problem?

  • @lykagracetabiolo7418
    @lykagracetabiolo7418 Před 7 měsíci

    Great i think this is the one video that you suggest me to want for deploying yolov5 in android.❤
    do you have a java version of this code? so that it will be compatible with the yolov5 model I have deploy earlier from your other video

    • @programming_hut
      @programming_hut  Před 7 měsíci

      Process will be similar you can try working out using chatgpt, maybe you can ask it to convert the code to java

  • @MightyStrongGuy
    @MightyStrongGuy Před rokem

    i love you 😍

  • @amirfaizm
    @amirfaizm Před měsícem

    Hi, I use Android API 34 for the sdk platform,these 3, SDK build tools, Android Emulator and sdk platform tools for the sdk tools. and yet, when i try to run the code (the code has no error), it says "please select android SDK". Do i need a specific sdk tools to run the code?

  • @exor6748
    @exor6748 Před rokem

    this is giving me error when I am using my own custom tflite model...I have also changed the labels but its still throwing error..please help

  • @mohammed._.sameer7753
    @mohammed._.sameer7753 Před 11 měsíci

    I am getting blackscreen after introducting of model section what should ido

  • @fansdrone5752
    @fansdrone5752 Před rokem

    The video is great. Many thanks. 👍👍
    I follow your video to deploy my Gundam Recognition tfile to android app. 👍👍
    But i got a problem, when i rotate my phone to landscape, the detection position will not correct. I had already written a rotation function but i got problem as i can't get textureView and camera bitmap in aligned rotation (only at portrait is aligned). Can you teach me how to solve? Many thanks.

  • @kukilkashyapborgohain4643

    I am getting blackscreen on emulator (Pixel Xl Android 12) and Redmi Note 9 pro. It was working fine till camera feed display. Please check. Error Log: E/CameraManagerGlobal: Camera 61 is not available. Ignore physical camera status change.

  • @LAJianoran
    @LAJianoran Před rokem

    how can i delay the result without affecting the camera?

  • @AlsibarJAhmad
    @AlsibarJAhmad Před 9 měsíci

    can you please make a video tutorial about this but add a voice speak that says what is the camera detecting like for example apple then the apps will say "apple" please

  • @studymeow525
    @studymeow525 Před 9 měsíci

    Can we add a currency dataset to tflite model? To make object and currency detector both together?

  • @isnaayu_m
    @isnaayu_m Před rokem

    great, how if i use .ptl ? can I ?

  • @sergosokolov4678
    @sergosokolov4678 Před 9 měsíci

    Why don't have ready app for download?

  • @maximood-tired
    @maximood-tired Před rokem

    hello, great video. what is your font in Android Studio?

    • @programming_hut
      @programming_hut  Před rokem +2

      It’s chalkboard

    • @maximood-tired
      @maximood-tired Před rokem

      @@programming_hut Apple Chalkboard or something else? Do you know how to get it on windows or linux?

    • @programming_hut
      @programming_hut  Před rokem +1

      I’ve never done that but I think this might help
      stackoverflow.com/questions/31681167/using-custom-font-for-android-studio-editor
      You can probably download chalkboard if possible or try any other alternative

    • @maximood-tired
      @maximood-tired Před rokem

      ​@@programming_hut alright thanks👍

    • @sushantkandwal
      @sushantkandwal Před rokem

      @@programming_hut can you provide full code I am getting penty of error

  • @bingebox4070
    @bingebox4070 Před 3 měsíci

    My model output shape is [1,6,8400] , so how can I get coordinates class labels and confidence score from output= Outputs.outputAsCategoryList?? Please Help me on this Brother , I looked online and could'nt find anything.

  • @NameName-jk4py
    @NameName-jk4py Před rokem

    Unable to instantiate activity ComponentINfo Getting this error at 10:24

  • @user-tb4pc3vn2t
    @user-tb4pc3vn2t Před rokem

    Rather than using a physical cameras device... Does anyone have experience using this with a FFMPEG YUV feed? Or some other grabbing of an existing video stream and feeding it into this code?

  • @ngsingwong3083
    @ngsingwong3083 Před rokem

    hi sir, what macbook system are you using?

  • @muhammadhussnain61
    @muhammadhussnain61 Před měsícem

    sir i have a problem related to emulator.. pixels problem sir.. emulator screen is blurry

  • @JeevanEkJang
    @JeevanEkJang Před rokem +1

    meko labels.txt ni milri bhai

  • @karanjitrandhawa1515
    @karanjitrandhawa1515 Před rokem

    Unresolved reference: Builder
    Hi sir I am facing this issue. Can you please help me out

  • @S0da0DA
    @S0da0DA Před 5 měsíci +2

    Can you make this, but with YOLOv8 TFLite?

  • @richlejesta3359
    @richlejesta3359 Před rokem

    val inputFeature0 = TensorBuffer.createFixedSize(intArrayOf(1, 224, 224, 3), DataType.FLOAT32)
    inputFeature0.loadBuffer(byteBuffer)
    sir what should i put in byteBuffer? or change]

    • @devpk1325
      @devpk1325 Před 2 měsíci

      same here

    • @devpk1325
      @devpk1325 Před 2 měsíci

      val model = Yolov5s.newInstance(context)
      // Creates inputs for reference.
      val inputFeature0 = TensorBuffer.createFixedSize(intArrayOf(1, 416, 416, 3), DataType.FLOAT32)
      inputFeature0.loadBuffer(byteBuffer)
      // Runs model inference and gets result.
      val outputs = model.process(inputFeature0)
      val outputFeature0 = outputs.outputFeature0AsTensorBuffer
      // Releases model resources if no longer used.
      model.close()

  • @ahmadsarji
    @ahmadsarji Před 7 měsíci

    It works for me but i am asking how i can add voice output feature to output the detected object??!!

  • @surajbogati9818
    @surajbogati9818 Před rokem

    does this work for our own model as well?

    • @programming_hut
      @programming_hut  Před rokem +1

      You can follow steps accordingly

    • @dikshasalunke1535
      @dikshasalunke1535 Před rokem

      @@programming_hut sir i want the output in voive format... so where I put TTS code plz help

  • @steel-r_ua
    @steel-r_ua Před 7 měsíci

    Please, do this: *Ctrl + A, Ctrl + L*

  • @IqraZahid-nk3yj
    @IqraZahid-nk3yj Před 7 měsíci

    Plzz make video of this project in Java language

    • @programming_hut
      @programming_hut  Před 7 měsíci

      This is similar
      tensorflow android | Deploy deep learning model android studio | Java | ml
      czcams.com/video/tySgZ1rEbW4/video.html

  • @UPS_
    @UPS_ Před rokem

    i can't find the code

  • @syedshorifulalamopu9470
    @syedshorifulalamopu9470 Před 4 měsíci

    10.1

  • @haritmengar
    @haritmengar Před rokem

    bro can you give me this source code download link

  • @IqraZahid-nk3yj
    @IqraZahid-nk3yj Před 7 měsíci

    Sir plzzz I have to submit my project in 2 days can you help me..... Make video in java language

    • @programming_hut
      @programming_hut  Před 7 měsíci

      I have already uploaded that
      Deploy Ml model on android | android project java | android studio | cat dog app
      czcams.com/video/aOYtdkzYmAY/video.html

  • @triciamoscare7475
    @triciamoscare7475 Před rokem

    How to create a tflite file with metadata if i am going to use my own model?

    • @programming_hut
      @programming_hut  Před rokem

      You tried official documentation ?
      www.tensorflow.org/lite/models/convert/metadata#model_information

  • @rambabupalla959
    @rambabupalla959 Před rokem

    Please can any one provide entire code
    I am getting errors

  • @ravindratiwari2993
    @ravindratiwari2993 Před 9 měsíci

    very fast explained...disappointing