This repository demonstrate the concept of Face recognition, specificly, Face client library for JavaScript. The Face service provides you with access to advanced algorithms for detecting and recognizing human faces in images.
The Azure Face service provides AI algorithms that detect, recognize, and analyze human faces in images. Facial recognition software is important in many different scenarios, such as identity verification, touchless access control, and face blurring for privacy.
- The latest version of Node.js
- Azure Storage Account
- Face API
Download the respository, And install dependencies :
$ git clone https://github.com/mmaous/facing-plan.git
$ cd facing-plan
$ npm install
After Creating Face API, You will need to copy the key and endpoint from Keys and Endpoint
in the sidebar, In order to connect your application to the Face API.
-
Now, create
Container
in your Azure Storage Account, give it Public access level ofContainer
, ClickCreate
. Then, Click the three dots, ChooseContainer properties
, Copy the URL. -
Create a file named
.env
, And paste the key, endpoint and URL:
ENDPOINT = "<YOUR_ENDPOINT>"
KEY = "<YOUR_KEY>"
IMAGE_BASE_URL =
'https://<Storage account Name>.blob.core.windows.net/<Container Name>/'
Execute the script:
$ npm start
NOTE: You can upload, content of
img
folder to your container to testDetectFaceExtract.js
script, Compare the output with theresult.txt
.
├── img
│ ├── img-1.jpg
│ ├── ...
│ └── img-6.jpg
├── scripts
│ ├── DetectFaceExtract.js
│ ├── FindSimilar.js
│ └── IdentifyInPersonGroup.js
├── config
│ └── index.js
├── index.js
├── README.md
└── package.json
-
Here's what's included:
img
– Contains images.scripts
– Contains JavaScript files (demos for Face client library).DetectFaceExtract.js
- Defines a method which parses and prints the attribute data for each detected face.FindSimilar.js
- Contains the code which takes a single detected face (source) and searches a set of other faces (target) to find matches (face search by image). When it finds a match, it prints the ID of the matched face to the console.IdentifyInPersonGroup.js
- Contains set of functions which help to Identify a face, This operation takes an image of a person (or multiple people) and looks to find the stored person object associated with each face in the image (facial recognition search). It compares each detected face to a PersonGroup, a database of different Person objects whose facial features are known.In order to do the Identify operation, you first need to create and train a PersonGroup.
config
- Defines configurations for Face Client Library.index.js
- Contains the main (fire) Function to test the scripts inscripts
folder.