Artificial Intelligence

Overview

Many of you must have used face filters like the age filter on Snapchat or the Blossom filter on Instagram. But did you ever wonder how these filters recognize our faces? In this lesson, we will learn how face filters work hands-on by making a project that lets you choose a filter among the ones displayed on the screen and apply it to your face.

Artificial Intelligence:

Artificial Intelligence is the study and design of intelligent agents (computers) that have the ability to analyze the environment and produce actions that maximize success.

Application of AI

Computer Vision

AI is used in many popular object recognition systems like self-driving cars, security systems, industrial robots, etc. In this example, the robot identifies the position of the pancakes and segregates them using a robotic arm.

Face Recognition

AI is widely used to detect and recognize faces from images. Facebook uses it to identify people in photos and tag them.

Gaming

AI plays an important role in helping a machine think of a large number of possible positions based on deep knowledge in strategic games such as chess or PUBG. An AI system called AlphaZero taught itself from scratch how to master the games of Chess, Shogi, and Go.

Expert Systems

Machine or software that imitates the decision-making ability of humans and uses it to provide explanations and advice to the users, e.g. YouTube uses it to recommend new videos.

Speech Recognition

Some AI-based speech recognition systems can ‘hear’ others, ‘express’ in the form of speech, and understand what a person tells it, e.g., Siri, Alexa, and Google Assistant.

Text Recognition from Image

The handwriting recognition software reads the text written on paper recognizes the shape of the letters and converts them into editable text. 

Intelligent Robots

These robots can perform the instructions given by a human in an interactive manner.

 

Face Detection

In the past few years, face recognition has become one of the most promising applications of computer vision. Face detection can be considered to be a substantial part of face recognition operations.

The method of face detection in pictures is complicated because, well, human faces are widely different from one another! They can have different poses, expressions, positions, orientations, skin color, glasses or facial hair or not, etc. Then are also differences in camera gain, lighting conditions, and image resolution.

Activity 1: Face Detection

Face recognition has become one of the most promising applications of computer vision. Face detection can be considered to be a substantial part of face recognition operations. In this lesson, we are learning about face detection extension and its blocks. The concept behind this session is to solidify knowledge of face detection extension and use different blocks related.

Let’s Code!

Setting Up the Stage

  1. Drag and drop a when flag clicked block into the scripting area.
  2. Snap a turn () video on stage with () transparency block from the Face Detection. Change the camera option to on and transparency to 0%.

The stage is set. Click the green flag to get the camera feed on the stage.

Recognize Image

  1. Add a forever block from the Control palette.
  2. Snap a analyse image from () block. Select the feed as the camera.
  3. Add an if-else () block below the analyse image from () block. Add an () > () block from the Operators palette in the condition of the if-else () block.
  4. In the first input, add a get # faces block and in the second input add the Numeric Value O.
  5. Next, add a say () block. Add a get expression of face () block from Face Detection palette in the input.
  6. Add another say () block with the input “No Face Detected”. This step will be executed if the condition in if-else () block isn’t satisfied.

Your script is now complete. Click the green flag to start the script.

Save the project file as Face Expression Detector.