Face Distance Estimation with OpenCV Python and Neural Networks on a Monocular Camera

  Рет қаралды 10,221

Nicolai Nielsen

Nicolai Nielsen

Күн бұрын

Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-ni... (PRICES WILL INCREASE SOON)
You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
_____________________________________________________________
In this video 📝 I'll show you how we can do monocular depth estimation with neural networks in OpenCV Python to faces that we detect with mediapipe. We will talk about the different models and then go through the code. Everything can be found on my GitHub. At the end of the video, we are going to test the different depth models and see the distance estimation for the detected faces.
If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
_____________________________________________________________
🛠️ Freelance Work: www.nicolai-ni...
_____________________________________________________________
💻💰🛠️ High Earner AI Career Program: www.nicolai-ni...
⚙️ Real-world AI Technical Courses: (www.nicos-scho...)
📗 OpenCV GPU in Python: www.nicos-scho...
📕 YOLOv7 Object Detection: www.nicos-scho...
📒 Transformer & Segmentation: www.nicos-scho...
📙 YOLOv8 Object Tracking: www.nicos-scho...
📘 Research Paper Implementation: www.nicos-scho...
📔 CustomGPT: www.nicos-scho...
_____________________________________________________________
📞 Connect with Me:
🌳 linktr.ee/nico...
🌍 My Website: www.nicolai-ni...
🤖 GitHub: github.com/nic...
👉 LinkedIn: / nicolaiai
🐦 X/Twitter: / nielsencv_ai
🌆 Instagram: / nicolaihoeirup
_____________________________________________________________
🎮 My Gear (Affiliate links):
💻 Laptop: amzn.to/49LJkTW
🖥️ Desktop PC:
NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
Intel I9-14900K: amzn.to/3W4Z5Cb
Motherboard: amzn.to/4aR6wBC
32GB RAM: amzn.to/3Jt2XVR
🖥️ Monitor: amzn.to/4aLP8hh
🖱️ Mouse: amzn.to/3W501GH
⌨️ Keyboard: amzn.to/3xUGz5b
🎙️ Microphone: amzn.to/3w1F1WK
📷 Camera: amzn.to/4b4Ryr9
_____________________________________________________________
Tags:
#DepthMap #MonocularDepth #DepthEstimation #ComputerVision #DistanceEstimation #OpenCV #FaceDetection #Mediapipe

Пікірлер: 27
@NicolaiAI
@NicolaiAI Жыл бұрын
Join My AI Career Program www.nicolai-nielsen.com/aicareer Enroll in My School and Technical Courses www.nicos-school.com
@lkamse3263
@lkamse3263 2 жыл бұрын
It is very commendable that your video is interpreted from the beginning every time, which brings a very good experience to your new audience.
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks a lot for the nice words!
@ivoirefresh3147
@ivoirefresh3147 3 жыл бұрын
Please make a blog where there will be all your tutorials with the codes. The contents are very informative
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Thank you very much! Good idea
@miklosforster3137
@miklosforster3137 Жыл бұрын
Hi @NicolaiNielsenAI, can you tell me, how did you find the parameters of scaling factor to calculate real distances from the relative inverse depth map? Thank you for your videos, your work is amazig, I learn a lot from them!
@KM1t3-kd2cg
@KM1t3-kd2cg 8 ай бұрын
Hey, can we do the same using YOLO model ?
@ilyablinov4979
@ilyablinov4979 3 жыл бұрын
Thanks Man!!! It’s very interesting!!!
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Thank you so much! Hope u will enjoy it
@dpredie
@dpredie 3 жыл бұрын
We can make apple’s cinematic mode with this. Detect new face, depth blur based on the mediapipe distance
@namnguyenhoai8852
@namnguyenhoai8852 2 жыл бұрын
Hi, what is the formula: (-1.7 * depth + 2), the number -1.7 and 2?
@Mohammed_Angler
@Mohammed_Angler Жыл бұрын
These are scale and shift values
@user-ivan0113
@user-ivan0113 Жыл бұрын
How to get those values?( scale and shift )
@Baydepe
@Baydepe Жыл бұрын
Hey, i was wondering if you can do the monocular vision method using python in thonny ide. I've been struggling with calculating the distance between tank cannon and the object that was detected with the "Webcam" Logitech C920 and compare it with Laser Range Finder :) hope you can give me some advice or else, thankyou !
@asmauhusna
@asmauhusna 2 жыл бұрын
can this be done in c++ with an OAK-D?
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Yeah for sure!
@dpredie
@dpredie 3 жыл бұрын
by the way, how did you get the depth_to_distance formula? wont that change depending on Camera calibration ( fx fy)
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Yes that would be depending on the focal length u have. I just made some real world references to convert the depth map to real world distances
@godsondeep241
@godsondeep241 2 жыл бұрын
@@NicolaiAI In my case the focal lenght of my camera is 50mm ..so how should i derive this part (-1.7 * depth + 2)
@NicolaiAI
@NicolaiAI 2 жыл бұрын
U need to make some real world references. Let's say u are 1 m away from the camera and then u take the depth value to that from the depth map. Create a couple of references and do linear regression on that to create a mapping from normalized depth values to real world depth estimates
@godsondeep241
@godsondeep241 2 жыл бұрын
@@NicolaiAI thanks for the quick reply ...is there not a smarter way ... and what if we want to infer on some random videos ...
@NicolaiAI
@NicolaiAI 2 жыл бұрын
U will need a way to map from the normalized depth values to ur own camera/images/environment. U can also just make an artificial mapping with some points u define urself, but then it will not be accurate to the real world
@abrarluvrabit
@abrarluvrabit Жыл бұрын
Hello all , while running the same code given in his github i am getting this error cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:270: error: (-5:Bad argument) Can't read ONNX file: models/model-f6b98070.onnx in function 'cv::dnn::dnn4_v20221220::ONNXImporter::ONNXImporter' Can somebody help me to resolve this error please.
@mms6794
@mms6794 Жыл бұрын
hi im new to this project. when i run the code, it says " cannot read .Onnx files" how to fix this?
@shahonwre5604
@shahonwre5604 2 жыл бұрын
i want find distance finger from camera i use kinect v2 can you help me ? but i want his distance mm by mm not cm by cm it have error how i can give that accuracy ??
@some12345_show
@some12345_show 7 ай бұрын
Can you provide the folder containing the models
@iceaurorahi1669
@iceaurorahi1669 Жыл бұрын
@NicolaiNielsenAI,I would like to ask what is the reason for the following error in running the system, and I would be grateful if you could solve my problem。 model = cv2.dnn.readNet(path_model + model_name) cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:274: error: (-5:Bad argument) Can't read ONNX file: models/model-small.onnx in function 'cv::dnn::dnn4_v20230620::ONNXImporter::ONNXImport
Monocular Depth Estimation with MiDaS Neural Networks
21:37
Nicolai Nielsen
Рет қаралды 34 М.
Ouch.. 🤕⚽️
00:25
Celine Dept
Рет қаралды 18 МЛН
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 936 М.
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 77 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 89 МЛН
Auto-Measuring with OpenCV + Python - Try It Yourself
25:17
Clayton Darwin
Рет қаралды 88 М.
Transform Depth Maps into Stunning Point Clouds with Open3D and Python
15:15
Самое простое объяснение нейросети
16:30
Программный Кот
Рет қаралды 125 М.
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 353 М.
12 New AI Projects using Raspberry-Pi, Jetson Nano & more
7:50
ToP Projects Compilation
Рет қаралды 775 М.
Simple Stereo | Camera Calibration
16:34
First Principles of Computer Vision
Рет қаралды 133 М.
How AI 'Understands' Images (CLIP) - Computerphile
18:05
Computerphile
Рет қаралды 207 М.
Boosting Monocular Depth Estimation to High Resolution (CVPR 2021)
4:51
Yağız Aksoy - Computational Photography Lab @ SFU
Рет қаралды 29 М.
Ouch.. 🤕⚽️
00:25
Celine Dept
Рет қаралды 18 МЛН