YOLOv4 and YOLOv3 Object Detection Using OpenCV | Windows Linux

  Рет қаралды 8,500

TheCodingBug

4 жыл бұрын

Use YOLOv3 and YOLOv4 for real time object detection with OpenCV. By the end of this video, you will be able to run pre-trained YOLOv3 and YOLOv4 on webcam and videos using OpenCV only. This method works for Windows, Linux, or Mac (Only CPU version if you do not own Nvidia GPU with CUDA support).
By default, it will run on CPU but if you want to run it with GPU acceleration, it requires OpenCV to be built with CUDA, for which you can follow this tutorial:
kzbin.info/www/bejne/qpu7nIpmYpmag6c
---------------------------------------------
► Time Steps:
Introduction: (0:00)
Setup: (0:46)
Download YOLOv3 and YOLOv4 Files: (1:31)
Write YOLO Inferencing Program: (2:43)
YOLOv3 Object Detection on CPU: (7:27)
YOLOv3 Object Detection on GPU: (7:53)
YOLOv4 Object Detection on GPU: (8:18)
---------------------------------------------
►Code for this video:
github.com/haroonshakeel/yolo_get_preds
---------------------------------------------
#TheCodingBug
#YOLOv3
#OpenCV
---------------------------------------------
► My Other Tutorials:
○Build and Install OpenCV 4.5.1 With CUDA GPU Support on Windows 10: kzbin.info/www/bejne/j6TQmX6Xp52ihcU
○ YOLOv4 On Android Using TFLite: kzbin.info/www/bejne/j6ukm3SJa7SmbsU
○ Install TensorFlow GPU Under 90 Seconds: kzbin.info/www/bejne/qqCtlmuQl6ube8U
○ Install PyTorch GPU Under 90 Seconds: kzbin.info/www/bejne/qJKlnJuLpMqCftU
○ Custom YOLOv4 Object Detection with TensorFlow and TFLite : kzbin.info/www/bejne/rKu3dH2DZp2opa8
○ Darknet YOLOv4 Custom Object Detection: Part 2 (Training YOLOv4 Darknet): kzbin.info/www/bejne/Y3-oc2iGYrh_n5I
○ Darknet YOLOv4 Custom Object Detection: Part 1 (Preparing Custom Dataset): kzbin.info/www/bejne/qXynqqaEqdObgJY
○ YOLOv4 Object Detection with TensorFlow, TFLite and TensorRT: kzbin.info/www/bejne/qnTQdGqkrst9ppo
○ Darknet YOLOv4 Object Detection for Windows 10 on Images, Videos, and Webcams: kzbin.info/www/bejne/fHaVeHWbgNqkpsU
○ Build and Install OpenCV 4.4.0 With CUDA (GPU) Support on Windows 10: kzbin.info/www/bejne/qpu7nIpmYpmag6c
○ Install TensorFlow GPU and PyTorch with CUDA on Windows 10 Anaconda | CUDA 10.1 cuDNN 7.6: kzbin.info/www/bejne/hp26aq13nJmWrpo
○ Real-time Multiple Object Tracking with YOLOv4 TensorFlow and Deep Sort | Linux, Windows: kzbin.info/www/bejne/fZLKenxrhaaYgck
---------------------------------------------
► Follow us on Twitter: BugCodingThe
► Support us on Patreon: www.patreon.com/TheCodingBug
---------------------------------------------
DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you!

Пікірлер: 28
@TheCodingBug
@TheCodingBug 3 жыл бұрын
*Possible Errors and Their Solutions (Thanks to our Patron: Comrade_Romanov)* I followed the video precisely and was getting 2 kind of errors when running darknet.exe 1.opencv_world451.dll was missing (even though i built it in CMake) Solution: Copy it from your OpenCV_build\install\x64\vc16\bin directly into darknet/ root folder 2.pthreadVC2.dll missing. Solution: Copy pthreadGC2.dll and pthreadVC2.dll from darknet\3rdparty\pthreads\bin\ folder to the darknet/ root folder. After that Yolov3 runs fine and is utilizing GPU.
@HangLe-se4el
@HangLe-se4el 2 жыл бұрын
Thank you! This is great video!What is your computer configuration? It worked but I didn't get the speed shown in the video.
@TheCodingBug
@TheCodingBug 2 жыл бұрын
Corei7, 16GB RAM, GTX1060
@abdulwahabamin7521
@abdulwahabamin7521 4 жыл бұрын
Great Video! Extremely Helpful. Would be looking forward to more!
@TheCodingBug
@TheCodingBug 4 жыл бұрын
Glad it was helpful!
@camilo.caceresf
@camilo.caceresf 4 жыл бұрын
Thank you!!!! This video was very helpful. It worked perfectly!!! As well the instructions of the video of OpenCV with GPU (It worked for me on version 4.5)
@TheCodingBug
@TheCodingBug 4 жыл бұрын
Thank you for your comment. I am glad I could help.
@teetanrobotics5363
@teetanrobotics5363 3 жыл бұрын
Amazing content. please order the playlists on your channel
@TheCodingBug
@TheCodingBug 3 жыл бұрын
I have made a couple of of Playlists, grouping together related videos.
@teetanrobotics5363
@teetanrobotics5363 3 жыл бұрын
@@TheCodingBug Thanks man, Amazing content. Keep it up
@nguyenvu6371
@nguyenvu6371 4 жыл бұрын
Great video. Im using Pycharm IDE. I saw your video about Build OpenCV with Cuda support. I sucessfully built it but still dont know how to add it to Pycharm. Could you please help?
@TheCodingBug
@TheCodingBug 4 жыл бұрын
Thank you for your comment. I am not sure how to use custom build OpenCV in Pycharm. It'd work with jupyter and command line though.
@nguyenvu6371
@nguyenvu6371 4 жыл бұрын
@@TheCodingBug I successfully added it to Pycharm. However, I got only 2 - 3 fps running yolov3 (with dnn cuda)
@TheCodingBug
@TheCodingBug 4 жыл бұрын
@@nguyenvu6371 which GPU do you have? Also, what FPS are you getting on CPU?
@nguyenvu6371
@nguyenvu6371 4 жыл бұрын
@@TheCodingBug on CPU, I got 1-2 fps. Im using old GPU type: Quadro K1100M 2Gb. I expected it to get about 6-7 fps
@TheCodingBug
@TheCodingBug 4 жыл бұрын
@@nguyenvu6371 I have tested it with GTX 1060 and GTX1050Ti and Its giving above 9FPS. I am not sure about older models. You can try building YOLOv4/v3 with Darknet (Tutorial link in the description above) or updating the Nvidia Driver and see if it makes any difference.
@martintan2625
@martintan2625 3 жыл бұрын
Hello may i know where did you get that japan video thanks haha cant seem to find it
@dompower500
@dompower500 4 жыл бұрын
Excellent training video. Nice explanation. When I tried Yolov3 everything worked well. However when I tried with Yolov4 , I get error message. "darknet_io.cpp:821: error: (-212:Parsing error) Unsupported activation: mish in function 'cv::dnn::darknet::ReadDarknetFromCfgStream". I assume this is bcs of my openCV version. My version is 4.3.0 I don't know...
@TheCodingBug
@TheCodingBug 4 жыл бұрын
You'd be needing opencv 4.4.0 for yolov4.
@ntchindagiscard3870
@ntchindagiscard3870 3 жыл бұрын
imutils not found , i get this errors from the utils file
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Install imutils by command pip install imutils
@ntchindagiscard3870
@ntchindagiscard3870 3 жыл бұрын
@@TheCodingBug i just did it and its working just fine, thanks for the amazing video
@fatiah541
@fatiah541 3 жыл бұрын
Hi not any file in gutup
@TheCodingBug
@TheCodingBug 3 жыл бұрын
GitHub link is there. Here is direct link: github.com/haroonshakeel/yolo_get_preds/blob/master/my_utils.py
@TheCodingBug
@TheCodingBug 4 жыл бұрын
Building OpenCV 4.4.0 with GPU from source: kzbin.info/www/bejne/qpu7nIpmYpmag6c YOLOv4 Darknet Windows: kzbin.info/www/bejne/fHaVeHWbgNqkpsU
@TheCodingBug
@TheCodingBug 4 жыл бұрын
@Prateek Gupta Yes. You can do that by configuring the location of your python libraries/dependencies during CMake process. Just search Python in CMake configuration window and you will see that right now, every path is set to your base path. Change them to your virtual env paths and it will install in virtual environment.
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 13 МЛН
World‘s Strongest Man VS Apple
01:00
Browney
Рет қаралды 54 МЛН
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН