I tried coding a AI DEPTH VISION app with MIDAS in 15 Minutes
HTML-код
- Опубликовано: 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 RUclips50 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 - Наука
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
Can you please check your discord,i personal messaged you
I would like to see you build a painting or sketch to photo API like Nvidia canvas
Oh man that was awesome. I'm always rooting for you to finish on time!
You nailed it indeed! Such amazing videos man, thanks a lot!
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?
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.
With 2 minutes to spare!! 🔥👏🏾
You’ve got the Midas touch 👀😂
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.
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!
Hey, any luck finding resources on this? I am also stuck here
thanks, Nichols for the amazing video, My question is how we can use the Depth Map for visual odometry?
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.
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. 😅
😅 LOL, gotta keep it interesting!
Looks awesome, I always wanted to predict Depth!
How sick is it right?!
Awesome stuff. Can you possibly do a cuda/gpu version of the same so that we can see the performance difference?
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)
Thank you very much for your videos!!
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
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.
Finally new ep!
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?
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 😊
Thank you so much for checking them out Omar!!
That was amazing, thank you
Waiting for your video!!!😇
Thank you for this Video!
Thank you for checking it out @musimply!
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?
King Nick is back with a banger ❤️
Ayyyyy, thanks a mil @Rahul!
Would it be possible to configure this to measure very small depth changes. Say under 1mm? With a greyscale picture?
Is Midas able to produce true depth/hight maps that could be used with CnC 2.5d bas relief carving?
can i use this model to estimate the depth after trained a model for object detection and instance segmentation ?
What a come back 🎉
Cheers Kevyn!! Pumped for the year ahead!
Can this model be used to convert a 2D camera feed into 3D ? Wanted to implement a similar idea for a project..
awesome video, like always! why did u run it on the cpu nd not the gpu??
awesome comment, somewhere else! why did u not watch the video??
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.
Hello, Nicholas.
When I try to run the code the kernel fails. Would you please help me resolve this problem?
Wow technology keeps on evolving. Didn’t think it was even possible.
Pretty cool right?! Been on my list to dig into for a while!
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.
YOu got a new sub bro (me), keep it up
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!
you should make more video on jetson nano using gpu.
You got it!
Nice to see
Thanks a mil @Dipanjan!
How do I get this to work with my macbook's web cam?
What is the unit of the depth calcuakted here....
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
you did it again
🙏🏽
Amazing!
🙏🏽
Please Make a video on video classification with CNN ,Transformer, media pipe holistic 🙏 🙏 🙏
You got it!
Awesome ❤️
Thanks a mil @Soumyadarshan 🙏🏽
Is remote oversea possible ?
Hey Nick, how do we extract the depth data from the output?
Heya Reuben, you can use the outputs variable it'll contain the depth measures!
@@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?
The model outputs only relative depth - i struggle on converting this to absolute depth…
depth = depth_map[y, x] where x and y are the coordinates of the point on the image
You did it !
@mmaxeator!! hell yeahhh!
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 RUclips 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 🥲
so fucking awesome!
Can we get the distance from the camera to the object ?? And how
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
To obtain meaningful distance measurements, you would need to apply a calibration step using reference distances or known object sizes in the scene.
Sir how to improve in making logics
Heya Bilal, you can grab the depth measures from the outputs variable and add logic from there :)
It would be actually funny woking that way at IBM . Penalties/Amazon giftcard "carrots and sticks" way .
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.
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!😅
That's why he can't answer technical questions in the comments or why he didn't explain the calibration process.
You are right
I use Midas v3.1 to convert movies in 3D, and I have good results.
Hi
Is there any tutorial or website for learning that
@@PreethamReddy-no7kn Hi, no, I dev my own software to create sbs 3D video.
@@cedvano ok, Thanks for the reply
Oooooh, that's an awesome idea! Might need to take a look.
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
Tried texting you on linkedin as well as instagram. No response! Please help