In this post, you'll learn how to build a face detection program using Python for yourself in less than 3 minutes.
Originally published by Sabina Pokhrel at https://towardsdatascience.com
Face detection is one of the most common applications of Artificial Intelligence. From camera applications in smartphones to Facebook’s tag suggestions, the use of face detection in applications is increasing every single day.
Face detection is the ability of a computer program to identify and locate human faces in a digital image.
With the increasing demand for face detection feature in applications, everyone is looking to use face detection in their application so that they are not left behind in the race.
In this post, I will teach you how to build a face detection program for yourself in less than 3 minutes.You will need to install the following python libraries if it is not already installed:
Here is the code to import the required python libraries, read an image from storage and display it.
# import libraries import cv2 import matplotlib.pyplot as plt import cvlib as cvimage_path = 'couple-4445670_640.jpg' im = cv2.imread(image_path) plt.imshow(im)
The code to detect faces in the loaded image, draw a bounding box around the detected faces and display the final image with detected faces is as follows.
faces, confidences = cv.detect_face(im)# loop through detected faces and add bounding box for face in faces: (startX,startY) = face,face (endX,endY) = face,face # draw rectangle over face cv2.rectangle(im, (startX,startY), (endX,endY), (0,255,0), 2)# display output plt.imshow(im)
Result of Face Detection on couple image
You have your face detection program ready. It is that simple!
To know more about cvlib library, you can visit the link
Thanks for reading ❤
If you liked this post, share it with all of your programming buddies!
This video on Data Science is a full course compilation that will help you gain all the concepts, techniques, and algorithms involved in data science. Python and R are the primary programming languages used for data science.
Data Science Full Course | Data Science For Beginners | Learn Data Science In 10 Hours
Here, you will understand the basics of data science, such as data munging, data mining, and data wrangling. You will come across how to implement linear regression (2:30:10), logistic regression (3:09:12), decision tree (3:27:04), random forest, support vector machines (5:17:21), time series analysis (7:33:05), and lots more.
You will get an idea about the salary, skills, jobs, and resume of a data scientist (9:00:04).
Finally, you will learn about the important data science interview questions (9:04:42) that would help you crack any data science interview. Now, let's get started and learn data science in detail.
Below topics are explained in this Data Science tutorial:
1. Data Science basics (01:28)
2. What is Data Science (05:51)
3. Need for Data Science (06:38)
4. Business intelligence vs Data Science (17:30)
5. Prerequisites for Data Science (22:31)
6. What does a Data Scientist do? (30:23)
7. Demand for Data Scientist (53:03)
8. Linear regression (2:30:10)
9. Decision trees (2:53:39)
10. Logistic regression in R (3:09:12)
11. What is a decision tree? (3:27:04)
12. What is clustering? (4:35:40)
13. Divisive clustering (4:51:14)
14. Support vector machine (5:17:21)
15. K-means clustering 96:44:13)
16. Time series analysis (7:33:05)
17. How to become a Data Scientist (8:26:54)
18. Job roles in Data Science (8:30:59)
19. Simplilearn certifications in Data Science (8:33:50)
20. Who is a Data Science engineer? (8:34:34)
21. Data Science engineer resume (9:00:04)
22. Data Science interview questions and answers (9:04:42)
This video will focus on the top Python libraries that you should know to master Data Science and Machine Learning. Here’s a list of topics that are covered in this session:
Thanks for reading ❤
If you liked this post, share it with all of your programming buddies!
Data Science vs Artificial Intelligence vs Machine Learning vs Deep Learning - Learn about each concept and relation between them for their ...
Data Science vs Artificial Intelligence vs Machine Learning vs Deep Learning - Learn about each concept and relation between them for their ...What is Data Science?
Data Science is an interdisciplinary field whose primary objective is the extraction of meaningful knowledge and insights from data. These insights are extracted with the help of various mathematical and Machine Learning-based algorithms. Hence, Machine Learning is a key element of Data Science.
Alongside Machine Learning, as the name suggests, “data” itself is the fuel for Data Science. Without the availability of appropriate data, key insights cannot be extracted from it. Both the volume and accuracy of data matters in this field, since the algorithms are designed to “learn” with “experience”, which comes through the data provided. Data Science involves the use of various types of data, from multiple sources. Some of the types of data are image data, text data, video data, time-dependent data, time-independent data, audio data, etc.
Data Science requires knowledge of multiple disciplines. As shown in the figure, it is a combination of Mathematics and Statistics, Computer Science skills and Domain Specific Knowledge. Without a mastery of all these sub-domains, the grasp on Data Science will be incomplete.What is Machine Learning?
Machine Learning is a subset or a part of Artificial Intelligence. It primarily involves the scientific study of algorithmic, mathematical, and statistical models which performs a specific task by analyzing data, without any explicit step-by-step instructions, by relying on patterns and inference, which is drawn from the data. This also contributes to its alias, Pattern Recognition.
Its objective is to recognize patterns in a given data and draw inferences, which allows it to perform a similar task on similar but unseen data. These two separate sets of data are known as the “Training Set” and “Testing Set” respectively.
Machine Learning primarily finds its applications in solving complex problems, which, a normal procedure oriented program cannot solve, or in places where there are too many variables that need to be explicitly programmed, which is not feasible.
As shown in the figure, Machine Learning is primarily of three types, namely: Supervised Learning, Unsupervised Learning and Reinforcement Learning.
Artificial Intelligence is a vast field made up of multidisciplinary subjects, which aims to artificially create “intelligence” to machines, similar to that displayed by humans and animals. The term is used to describe machines that mimic cognitive functions such as learning and problem-solving.
Artificial Intelligence can be broadly classified into three parts: Analytical AI, Human-Inspired AI, and Humanized AI.
From the above introductions, it may seem that these fields are not related to each other. However, that is not the case. Each of these three fields is quite closely related to each other than it may seem.
If we look at Venn Diagrams, Artificial Intelligence, Machine Learning and Data Science are overlapping sets, with Machine Learning being a subset or a part of Artificial Intelligence, and Data Science having a significant chunk of it under Artificial Intelligence and Machine Learning.
Artificial Intelligence is a much broader field and it incorporates most of the other intelligence-related fields of study. Machine Learning, being a part of AI, deals with the algorithmic learning and inference based on data, and finally, Data Science is primarily based on statistics, probability theory, and has significant contribution of Machine Learning to it; of course, AI also being a part of it, since Machine Learning is indeed a subset of Artificial Intelligence.
Similarities: All of the three fields have one thing in common, Machine Learning. Each of these is heavily dependent on Machine Learning Algorithms.
In Data Science, the statistical algorithms that are used are limited to certain applications. In most cases, Data Scientists rely on Machine Learning techniques to extract inferences from data.
The current technological advancement in Artificial Intelligence is heavily based on Machine Learning. The part of AI without Machine Learning is like a car without an engine. However, without the “learning” part, Artificial Intelligence is basically Expert Systems, Search and Optimization algorithms.
Difference between the three
Even though they are significantly similar to each other, there are still a few key differences that are to be noted.
Since all the three domains are interrelated, they have some common applications and some unique to each of them. Most applications involve the use of Machine Learning in some form or the other. Even then, there are certain applications of each domain, which are unique. A few of them are listed below:
Since the fields are interrelated by a significant degree, the skill-set required to master each of these fields is nearly the same and overlapping. However, there are a few skill-sets that are uniquely associated with each of them. The same has been discussed further.
The Job Market for each of these fields is in very high demand. As a direct quote from Andrew Ng says, “AI is the new Electricity”. This is quite true as the extended field of Artificial Intelligence is at the verge of revolutionizing every industry in ways that could not be anticipated earlier.
Hence, the demand for jobs in the field of Data Science and Machine Learning is quite high. There are more job openings worldwide than the number of qualified Engineers who are eligible to fill that position. Hence, due to supply-demand constraints, the amount of compensation offered by companies for such roles exceeds any other domain.
The job scenario for each of the different domains are discussed further:
Data Science, Machine Learning and Artificial Intelligence are like the different branches of the same tree. They are highly overlapping and there is no clear boundary amongst them. They have common skill set requirements and common applications as well. They are just different names given to slightly different versions of AI.
Finally, it is worth mentioning that since there is high overlap in required skill-set, an optimally skilled Engineer is eligible to work in either of the three domains and switch domains without any major changes.