Skip to content

Detect faces in an image using the REST API and JavaScript

License

Notifications You must be signed in to change notification settings

Savalone47/DetectFaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detect faces in an image using the REST API and JavaScript

In this tutorial, you will use the Azure Face REST API with JavaScript to detect human faces in an image

Face detection

The Face API can detect human faces in an image and return the rectangle coordinates of their locations. Optionally, face detection can extract a series of face-related attributes such as pose, gender, age, head pose, facial hair, and glasses.

The face detection feature is also available through the Computer Vision API, but if you wish to do further operations with face data, you should use the Face API (this service). For more information on face detection, see the Detect API

Prerequisites

Initialize the HTML file

    <!DOCTYPE html>
    <html>
        <head>
            <title>Detect Faces Sample</title>
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
        </head>
    <body></body>
</html>

Then add the following code inside the body element of the document. This sets up a basic user interface with a URL field, an Analyze face button, a response pane, and an image display pane

Run the script

Open index.html in your browser. When you click the Analyze face button, the app should display the image from the given URL and print out a JSON string of face data.

Resume

In this tutorial, you wrote a JavaScript script that calls the Azure Face API to detect faces in an image and return their attributes. Next, explore the Face API reference documentation to learn more. Face Api

About

Detect faces in an image using the REST API and JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors