How to Detect Faces in Images using C# in .NET Framework

Modern advances in software allow for the instant uploading and processing of images. When working with photographs that contain people, it is useful to have a system for identifying the different faces within the image, to help with metadata entry, captioning, and accessibility features. This API will allow you to detect faces within images instantly, with support for common file format such as PNG and JPEG.

Image for post
Image for post

Our first step is to run this command to install the SDK:

Install-Package Cloudmersive.APIClient.NET.ImageRecognition -Version 3.0.3

Then, we can call our function, FaceLocate:

using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.ImageRecognition.Api;
using Cloudmersive.APIClient.NET.ImageRecognition.Client;
using Cloudmersive.APIClient.NET.ImageRecognition.Model;

Now, you can instantly process your images and automatically return the number of faces detected within a photo. You can retrieve your free API Key from the Cloudmersive website. This will give you access to 800 monthly calls across our library of APIs.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store