Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pycon Thailand - Object Detection with YOLO in Python

Pycon Thailand - Object Detection with YOLO in Python

Kajal Puri

July 11, 2018
Tweet

More Decks by Kajal Puri

Other Decks in Technology

Transcript

  1. Object detection with YOLO in Python @Agirlhasnofame @kajal-puri kajal-puri.github.io @kajalp

    @kajalpuri @KajalP Kajal Puri Kajal Puri PyCon Thailand 16th June, 2018 1/22
  2. Object Recognition VS Detection • Object Recognition : In this,

    the machine learning algorithm is able to identify different objects in the image or moving video. This is also termed as “Object Classification” or “Object Identification” as we have to classify/identify the different type of objects. • Object Detection : In this, the machine learning algorithm must be able to find the location/coordinates of the identified object in the image or moving video. This is more difficult than recognition. Object Detection = Object classification + Localisation Kajal Puri PyCon Thailand 16th June, 2018 2/22
  3. Object Detection Three questions we need answers for : 1.

    What : It’s a classification task that answers the question “What different objects are in the image?” 2. Where : It’s a localization task which answers the question “Where is the object in the image?” 3. What AND Where : It’s a detection task as a whole that combines both “What” and “Where”? Difficulty of the task increases as we go from top to bottom. Kajal Puri PyCon Thailand 17th June, 2018 4/22
  4. Fast R-CNN VS YOLO • Difference in performances of Faster

    R-CNN and YOLO Kajal Puri PyCon Thailand 16th June, 2018 7/22
  5. Tracking Learning Detection • TLD is a method in which

    the machine learning algorithm tracks the object by learning its appearance as the video progresses. NOTE:-It uses the pre-trained or learned classifier to detect the object in the video. • In order for this classifier to perform well, it must have a good representation scheme of how the object looks so that the tracker can locate the object accurately. Often, it gives a poor performance because of similar reason. Kajal Puri PyCon Thailand 16th June, 2018 8/22
  6. YOLO Working • Solves the object detection problem as regression

    not classification. • For every positive position, the network predicts regression on each bounding box precise dimension and position. • After training of regressor bounding box, model trains to predict the confidence score on the final predicted bounding box. Kajal Puri PyCon Thailand 17th June, 2018 11/22
  7. YOLO Training • A pre-trained image classifier like VGGNet or

    Inception can behave as an object detector by sliding a small window across the image. • For each window, the classifier will give thousands of prediction of the object but only the most certain (high confidence score) prediction category will be taken into consideration. • YOLO divides the image into a grid of NXN cells for predicting a certain number of bounding boxes • The higher the confidence score for a category, the thicker bounding box will be formed around it to prove the certainty. • The confidence score combines with the class prediction score which gives probability that a bounding box contains a specific type of object. Kajal Puri PyCon Thailand 17th June, 2018 12/22
  8. Advantages of YOLO-I Advantages of YOLO : • Speed :

    It's very fast to implement in real time. Processes 45 frames per second for extremely accurate results and 155 frames per second for lesser accurate results. • Open Source • It considers the whole image into consideration while training and testing to avoid leaving any contextual information about its classes and their appearance. Kajal Puri PyCon Thailand 16th June, 2018 17/22
  9. Advantages of YOLO-II Advantages of YOLO : • YOLO learns

    generalized representation of objects which makes it less prone to "overfitting" problem. Note: "Overfitting" is a modelling error which occurs when the model learns overly complex information, also known as residual variation or noise as the features of the data points. • It's design/architecture enables it for end-to-end training with high precision and fast processing in real time Kajal Puri PyCon Thailand 16th June, 2018 18 /22
  10. Applications of Human Detection • Heat Map of a market/place

    - Automated generation of the crowd heat-map using a CCTV footage to make it more user friendly. It can be integrated with google maps/zomato or other websites to suggest people timings/days to visit Kajal Puri PyCon Thailand 16th June, 2018 19/22
  11. Applications of Human Detection • For Surveillance - It can

    be used to detect abnormal activities like theft, robbery etc. in banks, government offices, stores etc. Kajal Puri PyCon Thailand 17th June, 2018 20/22
  12. Advanced Applications of Human Detection • Motion detection - On

    an advanced level, this methodology can be expanded to give an idea of the speed with which the object/human is moving in the video i.e. it can give as a speedometer. This can be used by insurance companies, traffic ticketing agencies etc. Kajal Puri PyCon Thailand 16th June, 2018 21/22
  13. Advanced Applications of Human Detection Gender Classification - On an

    advanced level, this technique can also be used to classify two genders. This can be used in a gathering like conferences, colleges, workplaces to check if they are a gender-diverse organisation or not. Kajal Puri PyCon Thailand 16th June, 2018 22/22