I tried coding a AI DEPTH VISION app with MIDAS in 15 Minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ม.ค. 2023
  • MiDaS was originally developed by researchers at Intel for Robust Monocular Depth Estimation...aka derving how far objects are using a single standard camera. We're going to try to build an OpenCV app with it using Python in just 15 minutes.
    Good to be back to Code That!
    Get notified of the free Python course on the home page at www.coursesfromnick.com
    Sign up for the Full Stack course here and use TH-cam50 to get 50% off:
    www.coursesfromnick.com/bundl...
    Hopefully you enjoyed this video.
    💼 Find AWESOME ML Jobs: www.jobsfromnick.com
    Thanks again to Seeed Studio for the Jetson Nano, check them out here: www.seeedstudio.com/reCompute...
    Oh, and don't forget to connect with me!
    LinkedIn: bit.ly/324Epgo
    Facebook: bit.ly/3mB1sZD
    GitHub: bit.ly/3mDJllD
    Patreon: bit.ly/2OCn3UW
    Join the Discussion on Discord: bit.ly/3dQiZsV
    Happy coding!
    Nick
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 90

  • @NicholasRenotte
    @NicholasRenotte  ปีที่แล้ว +15

    Finally getting back to it!! Went back to the old school format where I talk while coding, hope y'all like it. Code is here: github.com/nicknochnack/CodeTHat-MiDaS

    • @demonxsave9471
      @demonxsave9471 ปีที่แล้ว

      Can you please check your discord,i personal messaged you

    • @mr-hotspot-2543
      @mr-hotspot-2543 ปีที่แล้ว

      I would like to see you build a painting or sketch to photo API like Nvidia canvas

  • @Arvolve
    @Arvolve 9 หลายเดือนก่อน +1

    You nailed it indeed! Such amazing videos man, thanks a lot!

  • @tgmeggitt1
    @tgmeggitt1 ปีที่แล้ว +1

    Oh man that was awesome. I'm always rooting for you to finish on time!

  • @FlickCliper
    @FlickCliper ปีที่แล้ว +3

    I love the way you teach us about programming, I've watched your previous videos on facemask detection, can you possibly make a Python program that classifies rotting, discoloration, or cratering on celery stalks by image detection?

  • @agustinsaavedra4273
    @agustinsaavedra4273 7 หลายเดือนก่อน

    Thank you for the example code with Midas.
    Since I was using python 3.10 I also needed the timm library but by downloading the library with pip
    "pip install timm"
    I was able to use the cuda option instead of the cpu one.

  • @Jaybaas
    @Jaybaas ปีที่แล้ว +3

    With 2 minutes to spare!! 🔥👏🏾
    You’ve got the Midas touch 👀😂

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +2

      LOL 🤌🏽⚱️ I woke up yesterday and In my mind I was like I am going to get this, gotta make it at least a few times this year.

  • @san-um7iv
    @san-um7iv ปีที่แล้ว +1

    Hi Nicholas,
    Thank you for such a great video.
    I would like to know how can I train my custom dataset using the MiDaS model.

  • @armanneyestani3433
    @armanneyestani3433 ปีที่แล้ว +1

    thanks, Nichols for the amazing video, My question is how we can use the Depth Map for visual odometry?

  • @weareone2069
    @weareone2069 ปีที่แล้ว +1

    hello Nicholas. Your channel has helped me a lot in my problems. Thanks for sharing. Also please could you make a video to combine object detection with midas. This will be very helpful!

    • @psyir5593
      @psyir5593 ปีที่แล้ว +1

      Hey, any luck finding resources on this? I am also stuck here

  • @edwardmoenga9368
    @edwardmoenga9368 ปีที่แล้ว +1

    Awesome stuff. Can you possibly do a cuda/gpu version of the same so that we can see the performance difference?

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 10 หลายเดือนก่อน +1

    Thank you very much for your videos!!

  • @mr.sweaty7862
    @mr.sweaty7862 ปีที่แล้ว

    I would really like a video where you take the some of the different NN models you've made (tweaked to the same data), put then through a ensemble to a .h5 file, then converted to protobuf and used in a c# script

  • @jakubkahoun8383
    @jakubkahoun8383 ปีที่แล้ว +2

    Looks awesome, I always wanted to predict Depth!

  • @bdanuw
    @bdanuw ปีที่แล้ว

    That is great! Need ro try as soon as I get to my laptop...
    (Side note, which nano is that? Tried to reset mine a d won't start of you have had that issue, please reply with pointers)

  • @bartoszhojnacki2233
    @bartoszhojnacki2233 ปีที่แล้ว +1

    Finally new ep!

  • @omar7613
    @omar7613 ปีที่แล้ว +4

    Love you Renotte I admire your hard work. Please make more education videos. I LOVED the GAN video enjoyed every second of it. Your skills are top tier impressive thank you for sharing them 😊

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +1

      Thank you so much for checking them out Omar!!

  • @JimBob-lq1db
    @JimBob-lq1db 8 หลายเดือนก่อน

    That was amazing, thank you

  • @rustcohle9134
    @rustcohle9134 ปีที่แล้ว

    Great!!
    what is the accuracy of the model?
    like if i want to measuring an object and object size is 20mm this model can measuring it close to 20mm?

  • @yamani3882
    @yamani3882 ปีที่แล้ว +15

    Please don’t put a timer on yourself or restrictions to what resources you can access. I literally feel the anxiety myself and lose focus. 😅

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +2

      😅 LOL, gotta keep it interesting!

  • @user-nd1mv2ug8p
    @user-nd1mv2ug8p 11 หลายเดือนก่อน

    Hey could you explain how to download visual studio code on the jetson nano? What version did you use and how'd you get it on there?

  • @katu406
    @katu406 ปีที่แล้ว +1

    Waiting for your video!!!😇

  • @rahulkiroriwal8779
    @rahulkiroriwal8779 ปีที่แล้ว +2

    King Nick is back with a banger ❤️

  • @mr.sweaty7862
    @mr.sweaty7862 ปีที่แล้ว

    Would it be possible to configure this to measure very small depth changes. Say under 1mm? With a greyscale picture?

  • @faqu2gamer566
    @faqu2gamer566 9 หลายเดือนก่อน

    Is Midas able to produce true depth/hight maps that could be used with CnC 2.5d bas relief carving?

  • @mustimply9317
    @mustimply9317 ปีที่แล้ว +1

    Thank you for this Video!

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +1

      Thank you for checking it out @musimply!

  • @kevynkrancenblum5350
    @kevynkrancenblum5350 ปีที่แล้ว +1

    What a come back 🎉

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +1

      Cheers Kevyn!! Pumped for the year ahead!

  • @yasminebaroud3965
    @yasminebaroud3965 ปีที่แล้ว

    can i use this model to estimate the depth after trained a model for object detection and instance segmentation ?

  • @generationgap416
    @generationgap416 ปีที่แล้ว

    I think you are more of a marketer than an ML engineer, LOL. Why? your use of a countdown clock: that is the gamification of marketing. We were all hoping that you make out alive. Clever, dude. Great video.

  • @homealone75
    @homealone75 ปีที่แล้ว +1

    Wow technology keeps on evolving. Didn’t think it was even possible.

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว

      Pretty cool right?! Been on my list to dig into for a while!

  • @atharvamadiwale8096
    @atharvamadiwale8096 11 หลายเดือนก่อน

    Can this model be used to convert a 2D camera feed into 3D ? Wanted to implement a similar idea for a project..

  • @varunvijay6546
    @varunvijay6546 ปีที่แล้ว

    Hello, Nicholas.
    When I try to run the code the kernel fails. Would you please help me resolve this problem?

  • @g.s.3389
    @g.s.3389 ปีที่แล้ว +2

    you should make more video on jetson nano using gpu.

  • @kushagrgoyal9614
    @kushagrgoyal9614 ปีที่แล้ว +1

    awesome video, like always! why did u run it on the cpu nd not the gpu??

    • @lucyegan82
      @lucyegan82 ปีที่แล้ว

      awesome comment, somewhere else! why did u not watch the video??

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +1

      Midas requires the library, timm, which needs a newer version of CUDA than what I had available on the jetson. I think I could of fixed this by flashing a newer version of Jetpack but ran out of dev time.

  • @ruquz
    @ruquz ปีที่แล้ว

    hi nick im getting this error . FileNotFoundError: Could not find module 'C:\Users\ADMIN\anaconda3\lib\site-packages\torch\lib\caffe2_nvrtc.dll' (or one of its dependencies). Try using the full path with constructor syntax.

  • @snazalsingh2465
    @snazalsingh2465 4 หลายเดือนก่อน

    What is the unit of the depth calcuakted here....

  • @venkateshr6127
    @venkateshr6127 ปีที่แล้ว +2

    Please Make a video on video classification with CNN ,Transformer, media pipe holistic 🙏 🙏 🙏

  • @Abstract_Code
    @Abstract_Code ปีที่แล้ว +2

    Hey Nicholas, I wonder if you can make a tutorial on creating a custom object detection with YOLOv7. Thanks, and keep doing these great videos!

  • @heyricksander
    @heyricksander ปีที่แล้ว

    How do I get this to work with my macbook's web cam?

  • @reubenthomas1033
    @reubenthomas1033 ปีที่แล้ว +2

    Hey Nick, how do we extract the depth data from the output?

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว

      Heya Reuben, you can use the outputs variable it'll contain the depth measures!

    • @reubenthomas1033
      @reubenthomas1033 ปีที่แล้ว +2

      @@NicholasRenotte The outputs variable has the shape of an image (makes sense, because that's whats being plotted in imshow). But it doesn't seem like there's any absolute depth data. Does this model only output relative depth?

    • @davidschaupp5423
      @davidschaupp5423 ปีที่แล้ว

      The model outputs only relative depth - i struggle on converting this to absolute depth…

    • @davidmata3104
      @davidmata3104 11 หลายเดือนก่อน

      depth = depth_map[y, x] where x and y are the coordinates of the point on the image

  • @dipanjanmandal1771
    @dipanjanmandal1771 ปีที่แล้ว +2

    Nice to see

  • @dopered5821
    @dopered5821 ปีที่แล้ว

    Is remote oversea possible ?

  • @jerbky
    @jerbky ปีที่แล้ว +1

    you did it again

  • @gundachan
    @gundachan ปีที่แล้ว

    big fan of you bro I take many reference from object detection series and completed my college project........I need your help in regarding research paper...I never write and know how to write a research paper and my college want to prepare one for finals.....My writing skills are too simple and straightforward can you help me regarding this situation by providing some tips and references

  • @kadaliakshay6770
    @kadaliakshay6770 2 หลายเดือนก่อน

    YOu got a new sub bro (me), keep it up

  • @mmaxeator
    @mmaxeator ปีที่แล้ว +1

    You did it !

  • @robinchriqui2407
    @robinchriqui2407 ปีที่แล้ว +1

    Amazing!

  • @soumyadarshandash7255
    @soumyadarshandash7255 ปีที่แล้ว +1

    Awesome ❤️

  • @sruthisajeev
    @sruthisajeev ปีที่แล้ว

    Hey bro..
    This is Sruthy
    I'm doing master's in construction engineering and management. And I've been researching on Real time hand signal detection for safe material handling at Construction site..as a part my final year thesis..I've been learning your course on TH-cam titled "Tensorflow Object Detection in 5 hours with Python" for the past 2 weeks..And I've been working on my thesis simultaneously.
    I got stuck at Project 2: Web Direction using Tensorflow JS.. In that, I've some trouble using my IBM Cloud account. When i tried to create a new account..i couldn't use it for free..or its not authorising my account eventhough i gave my credit card details..
    Is there any way to make this work without IBM account. Please do help me 🥲

  • @bilalahmed1247
    @bilalahmed1247 ปีที่แล้ว +1

    Sir how to improve in making logics

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว

      Heya Bilal, you can grab the depth measures from the outputs variable and add logic from there :)

  • @vamsiaccount8592
    @vamsiaccount8592 ปีที่แล้ว

    Can we get the distance from the camera to the object ?? And how

    • @davidmata3104
      @davidmata3104 11 หลายเดือนก่อน

      def calculate_distance(output, x, y):
      # Get the depth value at (x, y) coordinate
      depth = output[y, x]
      # Convert the depth value to distance (modify based on model-specific conversion)
      # For MiDaS, the depth values represent inverse depth, so we can calculate distance as 1/depth
      distance = 1 / depth
      return distance

    • @davidmata3104
      @davidmata3104 11 หลายเดือนก่อน

      To obtain meaningful distance measurements, you would need to apply a calibration step using reference distances or known object sizes in the scene.

  • @inadjaooponomarevj8990
    @inadjaooponomarevj8990 3 หลายเดือนก่อน

    so fucking awesome!

  • @romanemul1
    @romanemul1 ปีที่แล้ว

    It would be actually funny woking that way at IBM . Penalties/Amazon giftcard "carrots and sticks" way .

  • @bichhubiswa13
    @bichhubiswa13 ปีที่แล้ว +2

    Hi Nicholas,
    It's absolutely fine to take more time but please explain the things in detail,so that we can also understand the things clearly and it will be helpful for us.

  • @cedvano
    @cedvano ปีที่แล้ว +2

    I use Midas v3.1 to convert movies in 3D, and I have good results.

    • @PreethamReddy-no7kn
      @PreethamReddy-no7kn ปีที่แล้ว

      Hi
      Is there any tutorial or website for learning that

    • @cedvano
      @cedvano ปีที่แล้ว +1

      @@PreethamReddy-no7kn Hi, no, I dev my own software to create sbs 3D video.

    • @PreethamReddy-no7kn
      @PreethamReddy-no7kn ปีที่แล้ว

      @@cedvano ok, Thanks for the reply

    • @NicholasRenotte
      @NicholasRenotte  ปีที่แล้ว +1

      Oooooh, that's an awesome idea! Might need to take a look.

  • @hafezfarazi5513
    @hafezfarazi5513 ปีที่แล้ว +2

    Memorizing couple of line of codes (sometimes also looking at it) and typing it under arbitrary time constraints does not add any value to the viewers. Please find some new applications or explain underlying model. Just loading from torch hub is not coding challenge!😅

    • @davidmata3104
      @davidmata3104 11 หลายเดือนก่อน

      That's why he can't answer technical questions in the comments or why he didn't explain the calibration process.

    • @amrouhussein8303
      @amrouhussein8303 4 หลายเดือนก่อน

      You are right

  • @javlontursunov6527
    @javlontursunov6527 7 หลายเดือนก่อน +1

    Bro, thank you for the video but I am having there errors and I am leaving the error message here in the comment section. Having read this code, please provide a piece of advice to solve this error. Thank u in advance.
    Using cache found in C:\Users\user/.cache\torch\hub\intel-isl_MiDaS_master
    C:\Users\user\PycharmProjects\Midas\venv\lib\site-packages\torchvision\models\detection\anchor_utils.py:63: UserWarning: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xe (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:77.)
    device: torch.device = torch.device("cpu"),
    Loading weights: None
    Using cache found in C:\Users\user/.cache\torch\hub
    wightman_gen-efficientnet-pytorch_master
    Using cache found in C:\Users\user/.cache\torch\hub\intel-isl_MiDaS_master
    Traceback (most recent call last):
    File "C:\Users\user\PycharmProjects\Midas\main.py", line 27, in
    imgbatch = transform(img).to('cpu')
    File "C:\Users\user\PycharmProjects\Midas\venv\lib\site-packages\torchvision\transforms\transforms.py", line 95, in __call__
    img = t(img)
    File "C:\Users\user/.cache\torch\hub\intel-isl_MiDaS_master\hubconf.py", line 341, in
    lambda sample: torch.from_numpy(sample["image"]).unsqueeze(0),
    RuntimeError: Numpy is not available
    Process finished with exit code 1

  • @sruthisajeev
    @sruthisajeev ปีที่แล้ว

    Tried texting you on linkedin as well as instagram. No response! Please help