{"id":5890,"date":"2020-10-22T19:56:39","date_gmt":"2020-10-22T19:56:39","guid":{"rendered":"https:\/\/data-science.gotoauthority.com\/2020\/10\/22\/how-to-build-gender-wise-face-recognition-and-counting-application-with-opencv\/"},"modified":"2020-10-22T19:56:39","modified_gmt":"2020-10-22T19:56:39","slug":"how-to-build-gender-wise-face-recognition-and-counting-application-with-opencv","status":"publish","type":"post","link":"https:\/\/wealthrevelation.com\/data-science\/2020\/10\/22\/how-to-build-gender-wise-face-recognition-and-counting-application-with-opencv\/","title":{"rendered":"How to Build Gender Wise Face Recognition and Counting Application With OpenCV"},"content":{"rendered":"<div id=\"tve_editor\" data-post-id=\"6566\">\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17551065ba4\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/1-Gender-Wise-Face-Recognition-with-OpenCV.png?resize=626%2C352&amp;ssl=1\" class=\"tve_image wp-image-6567\" alt=\"Gender Wise Face Recognition with OpenCV\" data-id=\"6567\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Gender Wise Face Recognition with OpenCV\" loading=\"lazy\" data-width=\"626\" data-height=\"352\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6567\" alt=\"Gender Wise Face Recognition with OpenCV\" data-id=\"6567\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Gender Wise Face Recognition with OpenCV\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/1-Gender-Wise-Face-Recognition-with-OpenCV.png?resize=626%2C352&amp;ssl=1\" data-width=\"626\" data-height=\"352\" data-recalc-dims=\"1\"><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\" data-css=\"tve-u-17551065bae\">\n<p dir=\"ltr\">In this article, we are going to learn how to build a computer vision and deep learning combination application. Which performs <strong>gender wise face recognition<\/strong> with opencv and counts the people in the image or in the video.<\/p>\n<p dir=\"ltr\">In other words with the help of deep learning and computer vision algorithms using python opencv as a <a href=\"https:\/\/dataaspirant.com\/python-packages-for-datamining\/\" target=\"_blank\" rel=\"noopener noreferrer\">modeling package<\/a>, we will classify the gender \u00a0and count the faces for a given image\/video.<\/p>\n<p dir=\"ltr\">Building these kinds of models makes life easier with the enhancements over the deep learning field.<\/p>\n<p dir=\"ltr\">Nowadays deep learning field is one of the most revolutionary technologies with rapid enhancement growth. It gives machines the <strong>ability to think<\/strong> and learn on their own. The key motivation for <a href=\"https:\/\/dataaspirant.com\/category\/deep-learning\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">deep learning is to build algorithms<\/a> that mimic the <strong>human brain<\/strong>.<\/p>\n<p dir=\"ltr\">You might have also heard about Computer Vision. Often abbreviated as <strong>OpenCV<\/strong>. Which is defined as a sub field of study that seeks to develop techniques to help computers \u201csee\u201d and understand the <a href=\"https:\/\/dataaspirant.com\/2017\/05\/03\/handwritten-digits-recognition-tensorflow-python\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">content of digital images<\/a> such as photographs and videos.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_tw_qs tve_clearfix\" data-url=\"https:\/\/twitter.com\/intent\/tweet\" data-via=\"\" data-use_custom_url=\"\" data-css=\"tve-u-17551065bf4\">\n<div class=\"thrv_tw_qs_container\">\n<div class=\"thrv_tw_quote\">\n<p class=\"\">Learn how to build a gender wise face recognition application with opencv #deeplearing #opencv #computervision #python\u00a0<\/p>\n<\/div>\n<p>\n\t\t\t<span><br \/>\n\t\t\t\t<i><\/i><br \/>\n\t\t\t\t<span class=\"thrv_tw_qs_button_text thrv-inline-text tve_editable\">Click to Tweet<\/span><br \/>\n\t\t\t<\/span>\n\t\t<\/p>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17551065bf5\">\n<p dir=\"ltr\">With the high end research in deep learning, a lot of new applications of computer vision techniques have been introduced. Which have now become integral \u00a0parts of our everyday lives.\u00a0<\/p>\n<p dir=\"ltr\">These include <\/p>\n<ul>\n<li class=\"\">Face recognition and indexing<\/li>\n<li class=\"\">Photo stylization<\/li>\n<li class=\"\">Machine vision in self-driving cars<\/li>\n<\/ul>\n<p dir=\"ltr\">We are not going to build the high end computer vision and deep learning application in this article. <\/p>\n<p dir=\"ltr\">But we are going to leverage both computer vision and deep learning to build face detection applications with techniques of<strong> face recognition with opencv<\/strong> python. Which not only counts the faces but also separates the male and female faces.<\/p>\n<blockquote class=\"\"><p><strong>Excited right ? <\/strong><\/p><\/blockquote>\n<p dir=\"ltr\">We are excited too \ud83d\ude42\u00a0<\/p>\n<p dir=\"ltr\">Before we drive further. Let\u2019s see what you are going to learn by the end of this article.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-17551065bf9\">\n<p>Let\u2019s start the discussions with understanding various applications of face recognition.<\/p>\n<h2 class=\"\" id=\"t-1603382168002\">Face Recognition or Detection Applications<\/h2>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-175510c2fbf\">\n<span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/2-Face-Recognition-Opencv.png?resize=626%2C352&amp;ssl=1\" class=\"tve_image wp-image-6574\" alt=\"Face Recognition Applications\" data-id=\"6574\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Face Recognition Applications\" loading=\"lazy\" data-width=\"626\" data-height=\"352\" data-css=\"tve-u-175510c4253\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6574\" alt=\"Face Recognition Applications\" data-id=\"6574\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Face Recognition Applications\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/2-Face-Recognition-Opencv.png?resize=626%2C352&amp;ssl=1\" data-width=\"626\" data-height=\"352\" data-css=\"tve-u-175510c4253\" data-recalc-dims=\"1\"><\/span><\/p>\n<p class=\"thrv-inline-text wp-caption-text\">Face Recognition Applications<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Face recognition techniques are the most promising techniques in computer vision. Using which we can develop and solve many real world \u00a0problems.\u00a0<\/p>\n<p dir=\"ltr\">Anything which requires <strong>human supervision<\/strong> can leverage the help of computer vision algorithms to build applications to reduce the manual effort.<\/p>\n<p dir=\"ltr\">One such an application is <strong>counting the people<\/strong>. This inspires us to develop a model which is able to detect gender and also count faces separately.<\/p>\n<p dir=\"ltr\">Before going to build this. Let\u2019s check a few more face recognition applications.<\/p>\n<h3 id=\"t-1603382168003\" class=\"\">Using Face Detection In Daily Life<\/h3>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-175510e7e3f\">\n<span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/3-Daily-Face-Recognition-Application.png?resize=626%2C352&amp;ssl=1\" class=\"tve_image wp-image-6577\" alt=\"Daily Face Recognition Application\" data-id=\"6577\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Daily Face Recognition Application\" loading=\"lazy\" data-width=\"626\" data-height=\"352\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6577\" alt=\"Daily Face Recognition Application\" data-id=\"6577\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Daily Face Recognition Application\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/3-Daily-Face-Recognition-Application.png?resize=626%2C352&amp;ssl=1\" data-width=\"626\" data-height=\"352\" data-recalc-dims=\"1\"><\/span><\/p>\n<p class=\"thrv-inline-text wp-caption-text\">Daily Face Recognition Application<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h4 class=\"\">1. To unlock mobile, without passcode<\/h4>\n<p dir=\"ltr\">Using face detection, we can unlock the phone without entering the password. The phone camera will detect your face and check if your face is matching with the \u00a0passcode face or not. If they find your face the phone lock will automatically open.\u00a0<\/p>\n<h4 class=\"\">2. Google photos grouping the same person photos<\/h4>\n<p dir=\"ltr\">Using face detection and recognition, the google\u00a0 photos can be grouped based on the different types of faces. A new album will be created according to the new face.<\/p>\n<h4 class=\"\">3. Facial recognition in surveillance<\/h4>\n<p dir=\"ltr\">Facial recognition can use in <strong>forensic investigations<\/strong> by automatically capturing and recognizing individuals in security footage or other videos. This helps in pinpointing the persons behaviour in the footage.<\/p>\n<h4 class=\"\">4.Track attendance in any sector<\/h4>\n<p dir=\"ltr\">Using face recognition has the potential to track students\u2019 or employee\u2019s attendance. In general, attendance sheets can allow students to sign another student, who is ditching class.\u00a0<\/p>\n<p dir=\"ltr\">So\u00a0 face recognition applications ensures students aren\u2019t skipping class. Face authentication is needed inorder to make attendance in class or office. <\/p>\n<p dir=\"ltr\">Phones or some electronic devices \u00a0are being used to scan \u00a0faces and match their photos against a database for validation.<\/p>\n<h4 class=\"\">5.Control access to sensitive areas<\/h4>\n<p dir=\"ltr\">Face recognition is able to work as a main of access control. To make sure \u00a0that only authorized individuals get into some places like, boardrooms, bank vaults,labs, and other sensitive locations.<\/p>\n<h3 id=\"t-1603382168004\" class=\"\">Face Detection High Level Application<\/h3>\n<p dir=\"ltr\">We have seen some low level applications. Now let\u2019s check some high level applications.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17551102b54\">\n<span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/4-Face-Detection-High-Level-Application.png?resize=626%2C352&amp;ssl=1\" class=\"tve_image wp-image-6580\" alt=\"Face Detection High Level Application\" data-id=\"6580\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Face Detection High Level Application\" loading=\"lazy\" data-width=\"626\" data-height=\"352\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6580\" alt=\"Face Detection High Level Application\" data-id=\"6580\" width=\"626\" data-init-width=\"1024\" height=\"352\" data-init-height=\"576\" title=\"Face Detection High Level Application\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/4-Face-Detection-High-Level-Application.png?resize=626%2C352&amp;ssl=1\" data-width=\"626\" data-height=\"352\" data-recalc-dims=\"1\"><\/span><\/p>\n<p class=\"thrv-inline-text wp-caption-text\">Face Detection High Level Application<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<h4 class=\"\">1. Amazon Just Walk Out \u00a0Technology<\/h4>\n<p dir=\"ltr\">The <a href=\"https:\/\/dataaspirant.com\/amazon-go-just-walkout-technology\/\" target=\"_blank\" rel=\"noopener noreferrer\">amazon just walk out technology<\/a> \u00a0helps in identifying the person and detecting the amount from his amazon wallet for the items he\/she collected from the shops.<\/p>\n<h4 class=\"\">2. Students Engagement<\/h4>\n<p dir=\"ltr\">In western countries schools. Face recognition is extensively use to Identify the student faces and on top of that creates data points. Which helps in understanding \u00a0the student&#8217;s activeness based on the type of class or lecture. Now the same will help in <a href=\"https:\/\/dataaspirant.com\/four-coursera-data-science-specializations-starts-this-month\/\" target=\"_blank\" rel=\"noopener noreferrer\">online courses<\/a> too.<\/p>\n<h4 class=\"\">3.\u00a0 Faster Payments<\/h4>\n<p dir=\"ltr\">Face detection technology enables a more secure and faster \u00a0way to make payments. By selecting \u00a0into a pay-by-face technique, individuals can tie their face to normal payment methods. Which helps in fast \u00a0purchases using their faces as a payment method.<\/p>\n<p dir=\"ltr\">\u00a0Which reduces the offline and online fraud transaction. If we are still using the traditional way of payments, We need model to indentify the <a href=\"https:\/\/dataaspirant.com\/credit-card-fraud-detection-classification-algorithms-python\/\" target=\"_blank\" rel=\"noopener noreferrer\">fraud activities identification models<\/a>.<\/p>\n<h4 class=\"\">4.Finding Missing Persons<\/h4>\n<p dir=\"ltr\">Face recognition can be used to find <strong>missing childrens<\/strong> or people. If missing individuals are added to a database. The system can become alerted as soon as they are <strong>recognized<\/strong> by face recognition.\u00a0<\/p>\n<p dir=\"ltr\">It can be attached in\u00a0 airports, retail stores or other public space. Do you believe or not , in India 3000 missing children were discovered in just 4 days using face recognition.<\/p>\n<p dir=\"ltr\">We learned the potential application around face recognition models. Now let\u2019s learn how we can build such face detection application with <a href=\"https:\/\/opencv.org\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">python opencv library<\/a>.<\/p>\n<h2 id=\"t-1603382168005\" class=\"\">Face Recognition Modeling Approach\u00a0<\/h2>\n<p dir=\"ltr\">Building the face recognition counter is not a straightforward way. It&#8217;s not easy like <a href=\"https:\/\/dataaspirant.com\/random-forest-classifier-python-scikit-learn\/\" target=\"_blank\" rel=\"noopener noreferrer\">building randomforest model<\/a> or <a href=\"https:\/\/dataaspirant.com\/decision-tree-algorithm-python-with-scikit-learn\/\" target=\"_blank\" rel=\"noopener noreferrer\">building decision tree<\/a> model.\u00a0<\/p>\n<p dir=\"ltr\">It required two main tasks. <\/p>\n<p dir=\"ltr\">One is to build a deep learning model which is able to detect gender of a person and also return the count of males and females. Next count of faces in an image or video.<\/p>\n<p dir=\"ltr\">As you already guessed the implementation. It will happen in two levels. Let&#8217;s understand about this two stage modeling a bit deeper.\u00a0<\/p>\n<h3 id=\"t-1603382168006\" class=\"\">Two Stage Modeling<\/h3>\n<p dir=\"ltr\">We are going to build the face detection counting in two stages.\u00a0<\/p>\n<ul class=\"\">\n<li>Stage-1 &#8211; Model Training stage<\/li>\n<li>Stage-2 &#8211; cascading and evaluation stage.<\/li>\n<\/ul>\n<h4 class=\"\">Model Training Stage<\/h4>\n<p dir=\"ltr\">In the first stage we are going to train the CNN (Convolutional Neural Networks) \u00a0model with both male and female images. In the next step we will save the trained model for the next stage.<\/p>\n<h4 class=\"\">Cascading and evaluation stage\u00a0<\/h4>\n<p dir=\"ltr\">In the second stage we will \u00a0detect the faces using cascading files. If you don&#8217;t know about the cascading files don\u2019t worry. You are going to understand about it in the next section.<\/p>\n<p dir=\"ltr\">We load the cascading files and pass faces to the trained model. The well trained model returns whether the face is male or female. <\/p>\n<p dir=\"ltr\">As a final step we are going to use <strong>len()<\/strong> to find out the number of faces in an image or video.<\/p>\n<h2 id=\"t-1603382168007\" class=\"\">Face Recognition Complete Workflow<\/h2>\n<p dir=\"ltr\">This <strong>two stage approach<\/strong> makes more sense if we understand the models workflow architecture.<\/p>\n<p dir=\"ltr\">Before that Let\u2019s understand what the cascade classifier means.\u00a0<\/p>\n<h3 id=\"t-1603382168008\" class=\"\">What is Cascade Classifier<\/h3>\n<p dir=\"ltr\">Cascade classifiers is an effective object detection method proposed by Paul Viola and Michael Jones in their paper, &#8220;Rapid Object Detection using a Boosted Cascade of Simple Features&#8221; in 2001.\u00a0<\/p>\n<p dir=\"ltr\">Cascading is a special case of <a href=\"https:\/\/dataaspirant.com\/ensemble-methods-bagging-vs-boosting-difference\/\" target=\"_blank\" rel=\"noopener noreferrer\">ensemble learning<\/a>. It is a combination of \u00a0several classifiers. Using all information taken from the output to a given classifier as extra information for the next classifier in the cascade.<\/p>\n<p dir=\"ltr\">Unlike voting or stacking ensembles, cascading is a multistage one.<\/p>\n<p dir=\"ltr\">Cascading classifiers are trained with several hundred <strong>&#8220;positive&#8221;<\/strong> images of a particular object and arbitrary &#8220;negative&#8221; images of the equal size.\u00a0<\/p>\n<p dir=\"ltr\">After the classifier is trained it can be applied to a region of an image and detect the object based on requirement.<\/p>\n<h3 id=\"t-1603382168009\" class=\"\">Models Workflow Architecture<\/h3>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1755112a73b\">\n<span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/5-Cascade-and-CNN-Model-Architecture.png?resize=626%2C169&amp;ssl=1\" class=\"tve_image wp-image-6584\" alt=\"Cascade and CNN Model Architecture\" data-id=\"6584\" width=\"626\" data-init-width=\"2124\" height=\"169\" data-init-height=\"572\" title=\"Cascade and CNN Model Architecture\" loading=\"lazy\" data-width=\"626\" data-height=\"169\" data-css=\"tve-u-1755112b810\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6584\" alt=\"Cascade and CNN Model Architecture\" data-id=\"6584\" width=\"626\" data-init-width=\"2124\" height=\"169\" data-init-height=\"572\" title=\"Cascade and CNN Model Architecture\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/5-Cascade-and-CNN-Model-Architecture.png?resize=626%2C169&amp;ssl=1\" data-width=\"626\" data-height=\"169\" data-css=\"tve-u-1755112b810\" data-recalc-dims=\"1\"><\/span><\/p>\n<p class=\"thrv-inline-text wp-caption-text\">Cascade and CNN Model Architecture<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<ol class=\"\">\n<li class=\" dir=\">Input image is passed to Cascade Classifier\u00a0<\/li>\n<li class=\" dir=\">ROI (region of interest) is \u00a0extracted from the given image<\/li>\n<li class=\" dir=\">ROI- these are samples within a data set identified for a particular purpose.<\/li>\n<li class=\" dir=\">Resize the image into <strong>96 * 96<\/strong>\n<\/li>\n<li class=\" dir=\">Pass a resized image to trained CNN model , trained model is going to predict whether the face is a man or woman .<\/li>\n<li class=\" dir=\">With the help of the <strong>len()<\/strong> function , we can find out the number of faces in an image\/frame.<\/li>\n<\/ol>\n<h2 id=\"t-1603382168010\" class=\"\">Face Recognition with Opencv Python<\/h2>\n<p dir=\"ltr\">Enough of theory. Now comes the fun part. <\/p>\n<p dir=\"ltr\">Let us implement the face recognition with opencv. Which is the popular python computer vision library.<\/p>\n<p dir=\"ltr\">Let\u2019s start with the dataset we are going to use for building the model.<\/p>\n<h3 id=\"t-1603382168011\" class=\"\">Dataset Description<\/h3>\n<p dir=\"ltr\">The dataset consists of man and woman folders. Man folder is filled with <strong>1173<\/strong> images of the man and woman folder is filled with <strong>1134<\/strong> woman images respectively. we can find many similar datasets in different sources like kaggle, data.world etc.<\/p>\n<p dir=\"ltr\">You can also create your own dataset by using techniques like web scraping. Collect the set of man and woman images from the internet and save it into two different folders with folders names as man and woman.<\/p>\n<p dir=\"ltr\">\u00a0You can download this dataset from <a href=\"https:\/\/drive.google.com\/drive\/folders\/1fG9IDEDkxlj_ESOSvRGebwnq147PJRiF?usp=sharing\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">this link<\/a>.<\/p>\n<h3 id=\"t-1603382168012\" class=\"\">Files &amp; Libraries Required<\/h3>\n<ul class=\"\">\n<li class=\"\">\n<strong>Haarcascade_frontalface_default.xml\u00a0<\/strong><\/p>\n<ul>\n<li>Haar Cascade is a machine learning-based approach where a lot of positive and negative images are used to train the classifier.<\/li>\n<li>Positive images \u2013 These images contain the images which we want our classifier to identify.<\/li>\n<li>Negative Images \u2013 Images of everything else, which do not contain the object we want to detect.<\/li>\n<li>This file is used to find out \u00a0the faces in a given image.<\/li>\n<\/ul>\n<\/li>\n<li class=\"\">\n<strong>Libraries<\/strong><\/p>\n<ul>\n<li class=\" dir=\">Tensorflow , keras, h5py ,numpy,and opencv.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"t-1603382168013\" class=\"\">Building Convolution Neural Network<\/h3>\n<p dir=\"ltr\">By now we have the required files to build the model and we are also having the required libraries information.\u00a0<\/p>\n<p dir=\"ltr\">Now we are going to create a model using Convolutional Neural Networks. As every model building starts with importing libraries.<\/p>\n<p dir=\"ltr\">Let\u2019s import all the necessary python libraries.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 id=\"t-1603386636544\" class=\"\">Data preprocessing<\/h3>\n<p dir=\"ltr\">We are going to design how our input images are to be modified . We need to resize the images according to our model specifications. <\/p>\n<p dir=\"ltr\">In deep learning , it expects data to be in number format so that we convert our input image into an array with the <a href=\"https:\/\/keras.io\" target=\"_blank\" rel=\"noopener noreferrer\">help of keras library<\/a>.\u00a0<\/p>\n<p dir=\"ltr\">And next we need to <strong>split<\/strong> the data into <strong>training and validation<\/strong> data based on the given splitting ratio.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Defining the initial parameters for further use ,<\/p>\n<ul class=\"\">\n<li>\n<strong>Learning rate: <\/strong>learning rate is a tuning parameter in an optimization algorithm that determines the step size at each iteration.<\/li>\n<li>\n<strong>Batch size: <\/strong>number of training examples passed \u00a0in one iteration.<\/li>\n<li>\n<strong>Epochs:<\/strong> an epoch refers to one cycle through the full training dataset.\u00a0<\/li>\n<li>\n<strong>Image dimensions:<\/strong> we need to specify the image dimensions, here i\u2019m taking (96,96).<\/li>\n<li>Data and labels are two lists used to store images and its corresponding labels.<\/li>\n<li>\n<strong>Image_files<\/strong> stores all the images given by the path.<\/li>\n<\/ul>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Here, we are\u00a0<\/p>\n<ul class=\"\">\n<li>Loading each image and <strong>resizing<\/strong> according to our specified image dimensions.<\/li>\n<li>Converting resized image into <strong>array<\/strong>\n<\/li>\n<li>Appending that image\u00a0 into data list<\/li>\n<li>Extracting the label name from path using slicing eg:C:Desktopgender_datasetwomanface_113.jpg \u2192\u00a0 [-2] returns woman<\/li>\n<li>Labelling <strong>man =0 and woman =1<\/strong> and storing it into labels list.<\/li>\n<li>\n<strong>Repeating<\/strong> above steps for every image present in image_files.<\/li>\n<\/ul>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Here, we are <strong>normalizing<\/strong> the data and converting labels into an array. <\/p>\n<p dir=\"ltr\">Then we are splitting the data into training and testing in the ratio of <strong>80% training<\/strong> data and <strong>20% testing<\/strong> data .<\/p>\n<h3 id=\"t-1603386870354\" class=\"\">Data Augmentation<\/h3>\n<p dir=\"ltr\"><a href=\"https:\/\/dataaspirant.com\/data-augmentation-techniques-deep-learning\/\" target=\"_blank\" rel=\"noopener noreferrer\">Data augmentation<\/a> is the process of increasing the amount and diversity of data. It is used to <strong>increase<\/strong> the amount of data.<\/p>\n<p dir=\"ltr\">By adding slightly modified copies of <strong>already existing<\/strong> data or newly created synthetic data from existing data.<\/p>\n<p dir=\"ltr\">It helps <a href=\"https:\/\/dataaspirant.com\/handle-overfitting-deep-learning-models\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">reduce overfitting<\/a> when training a model.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Here,\u00a0<\/p>\n<p dir=\"ltr\">we are performing various operations \u00a0like\u00a0<\/p>\n<ul class=\"\">\n<li>\n<strong>rotation_range :<\/strong> degree range for random rotations.<\/li>\n<li>\n<strong>width_shift_range :<\/strong> fraction of total width<\/li>\n<li>\n<strong>height_shift_range :<\/strong> fraction of total height<\/li>\n<li>\n<strong>shear_range : <\/strong>shear angle in <strong>counter-clockwise<\/strong> direction in degrees.<\/li>\n<li>\n<strong>zoom_range :<\/strong> range for random zoom<\/li>\n<li>\n<strong>Horizontal_flip :<\/strong> randomly flip inputs horizontally.<\/li>\n<li>\n<strong>fill_mode :<\/strong> Points outside the boundaries of the input are filled according to the given mode on images to increase the data size .<\/li>\n<\/ul>\n<h3 id=\"t-1603386870355\" class=\"\">Defining the\u00a0 Convolutional Model<\/h3>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Here , we are\u00a0<\/p>\n<ul class=\"\">\n<li>Defining<strong> input shape<\/strong> \u00a0and its dimensions.<\/li>\n<li>Creating a <strong>Sequential model<\/strong> with <strong>5 hidden<\/strong> conv2D layers with the sequence of 32,64,64,128 and 256 hidden neurons respectively. Along with relu activation function, batchnormalization,maxpooling2D and Dropout.<\/li>\n<li>Flattening the data- (Flattening is converting the data into a 1-dimensional array for inputting it to the next layer).<\/li>\n<li>Dense layer with having 1024 neurons, relu activation function, batch normalization and 50% dropout ratio.<\/li>\n<li>Final output layer with <strong>2 neurons<\/strong> and <a href=\"https:\/\/dataaspirant.com\/difference-between-softmax-function-and-sigmoid-function\/\" target=\"_blank\" rel=\"noopener noreferrer\">sigmoid activation function<\/a>.<\/li>\n<\/ul>\n<p dir=\"ltr\">Above \u00a0all key terms are related to Convolutional Neural Networks. We used various activation functions please go through the <a href=\"https:\/\/dataaspirant.com\/popular-activation-functions-neural-networks\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">activation functions link<\/a> inorder to understand those keywords.\u00a0<\/p>\n<p dir=\"ltr\">Here my main focus is creating a convolutional neural network.<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Now compile the defined model having <strong>Adam optimizer.<\/strong> We are \u00a0defining <\/p>\n<ul>\n<li class=\"\">learning rate<\/li>\n<li class=\"\">binary_crossentropy loss<\/li>\n<li class=\"\">\u00a0accuracy metric<\/li>\n<\/ul>\n<p dir=\"ltr\">Then , we are fitting the model with <strong>100<\/strong> epochs \u00a0on \u00a0train and validation data. <\/p>\n<p dir=\"ltr\">Last, we are <a href=\"https:\/\/dataaspirant.com\/save-scikit-learn-models-with-python-pickle\/\" target=\"_blank\" rel=\"noopener noreferrer\">saving the model<\/a> with the name of <strong>\u2018gender_predictor\u2019<\/strong>\u00a0 by using the <strong>save()<\/strong> function.<\/p>\n<h2 id=\"t-1603386870356\" class=\"\">Gender Wise Face Counting via ComputerVision<\/h2>\n<h3 id=\"t-1603386870357\" class=\"\">Loading the gender prediction model<\/h3>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">In this we are going to<\/p>\n<ul class=\"\">\n<li>\u00a0import necessary libraries like cv2, tensorflow and numpy<\/li>\n<li>Load model and <strong>frontal_face haar cascading<\/strong> file<\/li>\n<li>Defining label names in a list form.<\/li>\n<\/ul>\n<h3 id=\"t-1603386870358\" class=\"\">Gender Face Detection Counting Function<\/h3>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Here, we are\u00a0<\/p>\n<ul class=\"\">\n<li>Firstly we took the passed input image.<\/li>\n<li>Then convert it into <strong>grayscale<\/strong> and save into a new variable named <strong>\u2018gray_image\u2019<\/strong>.<\/li>\n<li>\n<strong>detectMultiScale<\/strong> method is used to detect objects of different sizes in the input image.<\/li>\n<li>The detected objects are returned as a list of rectangles \u00a0and <strong>saved<\/strong> into the faces variable.<\/li>\n<li>len(faces) results number of faces in an image.<\/li>\n<li>Now, iterate each and every face which is \u00a0detected in above and draw a rectangle on top of it. \u00a0<strong>cv2.rectangle()<\/strong> method is used to draw a rectangle on any image<\/li>\n<li>Crop the input image. Resize it, normalize, convert it into an array and expand the shape of an array.<\/li>\n<li>Then pass it to the trained model and save the predicted outcome in the result variable.<\/li>\n<li>Use <strong>argmax<\/strong> for finding the class with the largest predicted probability from the result.<\/li>\n<li>If label = women, increment f variable , else increment m variable.<\/li>\n<li>cv2.putText() method is used to draw a text string on any image.<\/li>\n<li>With the help of this function display the resulting counts on an image.<\/li>\n<\/ul>\n<h2 id=\"t-1603386870359\" class=\"\">Face Recognition Model Testing\u00a0<\/h2>\n<p dir=\"ltr\">We build the complete pipeline for detecting the faces and identifying whether the face is male or female.<\/p>\n<p dir=\"ltr\">Now let\u2019s test our model. \u00a0For that we are going to show how we can evaluate both on images and videos (real time webcam).<\/p>\n<p dir=\"ltr\">We are not using any <a href=\"https:\/\/dataaspirant.com\/six-popular-classification-evaluation-metrics-in-machine-learning\/\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">classification evaluation metrics<\/a> or <a href=\"https:\/\/dataaspirant.com\/difference-between-r-squared-and-adjusted-r-squared\/\" target=\"_blank\" rel=\"noopener noreferrer\">regression evaluation metrics<\/a> here. <\/p>\n<p dir=\"ltr\">All we do is load a image and check Whether the faces are detected properly or not.<\/p>\n<h3 id=\"t-1603386870360\" class=\"\">Model Evaluation On Images<\/h3>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">Here , we are<\/p>\n<ul class=\"\">\n<li>Reading input image with the help of <strong>imread()<\/strong> function<\/li>\n<li>Maintaining separate <strong>counter variables<\/strong> for both males and females<\/li>\n<li>Passing an input image along with counter variables.<\/li>\n<li>Finally, <strong>closing<\/strong> all the active windows or tabs.<\/li>\n<\/ul>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-1755165b739\">\n<span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/6-Face-Recognition-Demo.png?resize=613%2C345&amp;ssl=1\" class=\"tve_image wp-image-6615\" alt=\"Face Recognition Demo\" data-id=\"6615\" width=\"613\" data-init-width=\"1024\" height=\"345\" data-init-height=\"576\" title=\"Face Recognition Demo\" loading=\"lazy\" data-width=\"613\" data-height=\"345\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6615\" alt=\"Face Recognition Demo\" data-id=\"6615\" width=\"613\" data-init-width=\"1024\" height=\"345\" data-init-height=\"576\" title=\"Face Recognition Demo\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/6-Face-Recognition-Demo.png?resize=613%2C345&amp;ssl=1\" data-width=\"613\" data-height=\"345\" data-recalc-dims=\"1\"><\/span><\/p>\n<p class=\"thrv-inline-text wp-caption-text\">Face Recognition Demo<\/p>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p dir=\"ltr\">From the above picture. We can observe, model accurately classified gender and return the exact count of both males and females and total faces in an image.<\/p>\n<h3 id=\"t-1603386870361\" class=\"\">Model evaluation with webcam<\/h3>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element tve-froala fr-box fr-basic\">\n<p dir=\"ltr\">Here , we are<\/p>\n<ul class=\"\">\n<li>Opening a webcam with <strong>VideoCapture().<\/strong> 0 means local machines webcam, if you have an external camera change number to 1 or 2 .\u00a0<\/li>\n<li>Read frame by frame from live <strong>streaming<\/strong> video.<\/li>\n<li>\u00a0Maintaining separate counter variables for both males and females as x and y<\/li>\n<li>Passing frame by frame \u00a0to the <strong>gender_facecounter()<\/strong> function along with \u00a0x and y variables.<\/li>\n<li>Exit the current tab when user presses enter key\u00a0<\/li>\n<li>Finally, <strong>closing<\/strong> all the active windows or tabs.<\/li>\n<\/ul>\n<h2 class=\"\" id=\"t-1603388575469\">What next<\/h2>\n<p>You can check code in our <a href=\"https:\/\/github.com\/saimadhu-polamuri\/DataAspirant_codes\/tree\/master\/face_reognition_with_opencv\" target=\"_blank\" class=\"tve-froala\" rel=\"noopener noreferrer\">dataaspirant GitHub repo<\/a>. Please feel free to check it out. You can ignore the <strong>code_for_blog.py<\/strong> file and consider all the other files.\u00a0<\/p>\n<p dir=\"ltr\">We have plenty of applications with deep learning. In recent times there is huge research going on deep learning and computer vision.<\/p>\n<p dir=\"ltr\">We can solve any problem with the help of deep learning. We have showed an \u00a0simple use case in deep learning and computer vision.<\/p>\n<p dir=\"ltr\">You \u00a0can try more creative projects \u00a0like<\/p>\n<ul>\n<li class=\"\">Vehicles detection<\/li>\n<li class=\"\">Hand Gesture recognition<\/li>\n<li class=\"\">DNA pattern recognition etc on your own.<\/li>\n<\/ul>\n<h2 class=\"\" id=\"t-1603388575470\">Conclusion<\/h2>\n<p dir=\"ltr\">In this article we learn how to build face recognition with opencv python package. We also learnt how we can leverage it to build face detection and counter application end to end. We also learn how the cascading works.\u00a0<\/p>\n<p dir=\"ltr\">As we said before don\u2019t limit to this. Use this code and do the modification to solve various object detection applications.<\/p>\n<p dir=\"ltr\">Let\u2019s say for a <strong>grocery kind<\/strong> of domain. A good application could detect the items in the shop and count the items to send a report to the store staff so they can plan to order required items ahead. This reduces a huge manual effort.<\/p>\n<\/div>\n<h4 class=\"\">Recommended Computer Vision Courses<\/h4>\n<div class=\"thrv_wrapper thrv-page-section thrv-lp-block\" data-inherit-lp-settings=\"1\" data-css=\"tve-u-17551065a46\" data-keep-css_id=\"1\">\n<div class=\"tve-page-section-in tve_empty_dropzone  \" data-css=\"tve-u-17481b960b8\">\n<div class=\"thrv_wrapper thrv-columns dynamic-group-kbt3q0q7\" data-css=\"tve-u-17481b95e2b\">\n<div class=\"tcb-flex-row v-2 tcb--cols--3 tcb-medium-no-wrap tcb-mobile-wrap m-edit\" data-css=\"tve-u-17551065a47\">\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17551065a5e\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17551065a61\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/Master-Computer-Vision\u2122-OpenCV4-in-Python-with-Deep-Learning-Course.jpg?resize=176%2C176&amp;ssl=1\" class=\"tve_image wp-image-6735\" alt=\"Master-Computer-Vision\u2122-OpenCV4-in-Python-with-Deep-Learning-Course\" data-id=\"6735\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"Master-Computer-Vision\u2122-OpenCV4-in-Python-with-Deep-Learning-Course\" loading=\"lazy\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17551065a62\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6735\" alt=\"Master-Computer-Vision\u2122-OpenCV4-in-Python-with-Deep-Learning-Course\" data-id=\"6735\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"Master-Computer-Vision\u2122-OpenCV4-in-Python-with-Deep-Learning-Course\" loading=\"lazy\" src=\"https:\/\/i1.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/Master-Computer-Vision%E2%84%A2-OpenCV4-in-Python-with-Deep-Learning-Course.jpg?resize=176%2C176&amp;ssl=1\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17551065a62\" data-recalc-dims=\"1\"><br \/>\n<span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17551065a49\">Master Computer Vision With OpenCV<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17551065a5f\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17551065a6e\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/course_1123_image.jpeg?resize=176%2C176&amp;ssl=1\" class=\"tve_image wp-image-6736\" alt=\"Computer vision quick start\" data-id=\"6736\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"Computer vision quick start\" loading=\"lazy\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17551065a6f\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6736\" alt=\"Computer vision quick start\" data-id=\"6736\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"Computer vision quick start\" loading=\"lazy\" src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/course_1123_image.jpeg?resize=176%2C176&amp;ssl=1\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17551065a6f\" data-recalc-dims=\"1\"><br \/>\n<span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17551065a51\">Face Recognition OpenCV Quick Start\u00a0<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb-flex-col\">\n<div class=\"tcb-col dynamic-group-kbt3pyfd\" data-css=\"tve-u-17481b95e2d\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad dynamic-group-kbt3pwhk\" data-css=\"tve-u-17551065a60\">\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper tve_image_caption dynamic-group-kbt3pu4z\" data-css=\"tve-u-17551065a70\"><span class=\"tve_image_frame\"><img src=\"https:\/\/i2.wp.com\/dataaspirant.com\/wp-content\/plugins\/lazy-load\/images\/1x1.trans.gif?ssl=1\" data-lazy-src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/Deep-learning-for-computer-vision2.png.jpeg?resize=176%2C176&amp;ssl=1\" class=\"tve_image wp-image-6739\" alt=\"Deep-learning-for-computer-vision2.png\" data-id=\"6739\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"Deep-learning-for-computer-vision2.png\" loading=\"lazy\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17551065a71\" data-recalc-dims=\"1\"><img class=\"tve_image wp-image-6739\" alt=\"Deep-learning-for-computer-vision2.png\" data-id=\"6739\" width=\"176\" data-init-width=\"150\" height=\"176\" data-init-height=\"150\" title=\"Deep-learning-for-computer-vision2.png\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/dataaspirant.com\/wp-content\/uploads\/2020\/10\/Deep-learning-for-computer-vision2.png.jpeg?resize=176%2C176&amp;ssl=1\" data-width=\"176\" data-height=\"176\" data-css=\"tve-u-17551065a71\" data-recalc-dims=\"1\"><br \/>\n<span class=\"tve-image-overlay\"><\/span><\/span><\/div>\n<h4 class=\"\" data-css=\"tve-u-17551065a58\">Learn Deep Learning and Computer Vision<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/dataaspirant.com\/gender-wise-face-recognition-with-opencv\/<\/p>\n","protected":false},"author":0,"featured_media":5891,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/5890"}],"collection":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/comments?post=5890"}],"version-history":[{"count":0,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/posts\/5890\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media\/5891"}],"wp:attachment":[{"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/media?parent=5890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/categories?post=5890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wealthrevelation.com\/data-science\/wp-json\/wp\/v2\/tags?post=5890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}