Detect Faces In An Image Using JavaScript And Canvas – facedetector.js

Category: Image | June 16, 2022
Author:crucifyer
Views Total:0 views
Official Page:Go to website
Last Update:June 16, 2022
License:MIT

Preview:

Detect Faces In An Image Using JavaScript And Canvas – facedetector.js

Description:

Have you ever wanted to detect faces in an image? Or were you tasked with creating a demo that could detect and highlight people’s faces in an uploaded picture?

This is a JavaScript-powered face detector that makes it easier to detect faces in an image using HTML5 canvas API. Supports both img and canvas tags. Take a look at the demo page to see it in action.

Basic usage:

1. Download and load the facedetector.js library.

<script src="./facedetector.js"></script>

2. Detect faces in an image using the XenoFaceDetector.Detect() function. Available parameters:

  • img: Target image or canvas element
  • im_width: Image Width
  • im_height: Image Height
  • multiple: Detect multiple faces in an image
  • resSize: Use the reduced image size. Default: 281.
const faces = XenoFaceDetector.Detect(img, im_width, im_height, multiple, resSize)

You Might Be Interested In:


Leave a Reply