filmov
tv
Object Detection using YOLO V4 Darknet
Показать описание
What is object detection
1) Bounding boxes
2) mAP – Mean Average Precision
3) Prediction Confidence
4) Fast (er) R-CNN, HOG, SSD etc. YOLO is the most recent and most effective
Real time video with frame rates above 30fps, forget about it.
What is YOLO V4
YOLO is the state of the art, real time Object detection system developed by Joseph Redmon at UoW. As opposed to the prior detection systems, YOLO uses a single neural network to process an image. Even though it too divides the image into regions and predicts bounding boxes, it does all of that in one pass, for the entire image and all of the object classes. Hence, the cheeky name “You only look once”, YOLO. Because of the fundamental difference in the way YOLO approaches detection, it is blazingly fast, compared to the earlier detection systems like R-CNN and fast R-CNN. (1000X and 100X respectively)
Alexey’s GitHub repository is a phenomenal source for learning more in depth stuff about YOLO. All of what you are about read and see in this blog are based on his very well written instructions. My aim was to simplify it a little bit and make it more accessible.
What is Darknet
Don’t be scared by the sinister sounding name. Unlike the ubiquitous dark-web which is internet's official black-market and shit hole, Darknet is simply a neural network. This neural network is open sourced and is written in C and CUDA. This can be compiled both for CPUs and GPUs, on both Linux and Windows flavors. I have tried it on my both my windows machines and Linux machines and had no issues whatsoever. It comes with a beautiful Python wrapper so you can run it with very little code both to train and test.
The great advantages of Darknet neural network are as follows:
1) All the source code is provided with the necessary configuration files. All you have to do is compile it to your working operating system. Further down in this blog, I will be walking you through installing and running it off Google’s colab.
2) Comes with pre-trained weights for MS COCO data set.
3) Comes with partially trained weights if you want to train your own classes. I have a blog coming up to walk you through training your own model with your custom classes.
4) You can train the model on a GPU (Which is the most computationally expensive process, but then you can use it on a CPU for detection and even in production systems)
What is MS Coco data set?
COCO stands for Common Objects in Context and consists of thousands of labelled images for 80 different classes. Each of these images contains one or more of the classes and has a “labels” file which tells us where the bounding boxes are for those classes. This is the dataset used by the designers of Darknet to train and evaluate the model. COCO data set has long been used to benchmark various object detection models. As I have said earlier, they have also made available the fully trained weights available for us, so we can simply use them to test the detector without having to worry about training the model from scratch. This is especially useful if you are just trying out the YOLO Darknet to make it part of your product pipeline. You do not have to go through the trouble of setting up the training process and spend time training the model. However, this only works if your data set consists predominantly of the 80 classes in the COCO data set. If you want to train your own models, I will show you how to do it in the next blog post.
YOLO on Colab
Ok, that’s enough introduction and its time to get your hands dirty with YOLO. The easiest way to get started is to try it out on Google’s Colab. Colab comes with all the necessary libraries pre-installed and can get the job done with minimal effort. Once you have done it a few times on colab, you can choose to run it locally on your own hardware. Let’s get started. Just an FYI, the instructions below are all based on Alexy’s GitHub wiki, and you might as well follow them verbatim. But if you want a little explanation to go with those instructions, please read on.
Prerequisites:
1) A google account which will also allow you to connect to colab.\
2) A few images to try out at the end.
Coming up…….
1) Train your own classes
2) Other uses of Darknet
Комментарии