AI.Facial.Emotion 25.5.16

dotnet add package AI.Facial.Emotion --version 25.5.16
                    
NuGet\Install-Package AI.Facial.Emotion -Version 25.5.16
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AI.Facial.Emotion" Version="25.5.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AI.Facial.Emotion" Version="25.5.16" />
                    
Directory.Packages.props
<PackageReference Include="AI.Facial.Emotion" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AI.Facial.Emotion --version 25.5.16
                    
#r "nuget: AI.Facial.Emotion, 25.5.16"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=AI.Facial.Emotion&version=25.5.16
                    
Install AI.Facial.Emotion as a Cake Addin
#tool nuget:?package=AI.Facial.Emotion&version=25.5.16
                    
Install AI.Facial.Emotion as a Cake Tool

AI.Facial.Emotion

AI.Facial.Emotion is a .NET library for analyzing facial attributes, including emotion. It seamlessly integrates with C#.NET, providing efficient and secure facial analysis with embedded AI models. Ideal for chatbots, customer insights, security, and healthcare applications.

Illustration

🚀 Demo: My demo website is hosted on Azure (FREE SKU) here

Azure demo

🚀 Features

  • Emotion Detection – Recognizes emotions such as happiness, sadness, anger, surprise, and more.
  • Optimized for .NET – Fully compatible with .NET 8, .NET 9 and .NET 10.
  • Easy Integration – Works seamlessly with ASP.NET Web APIs, Windows Application, allowing quick integration into existing projects.
  • Supports multiple input formats: URL, Base64, File Stream

⚡ Release note

25.5.16: Support from .NET 8 to .NET 10 (.NET 6 and .NET 7 is no longer supported)
25.3.26: Optimized for performance in compliance with the latest .NET 10 and C# 14.
25.3.16 Support for the newly released .NET 9 and .NET 10
25.3.11 Update the Readme
25.3.4.2231. Allow user can adjust the Target hardware like CPU, CUDA
25.3.4. Allow user can adjust the threshold, topK and nms
25.3.3. Improve the performance

📦 Installation

You can install this library via NuGet Package Manager:

dotnet add package AI.Facial.Emotion

📦 Mandatory ingredients

  • If your server runs windows operating system
dotnet add package Emgu.CV.runtime.windows
  • If your server runs ubuntu operating system
dotnet add package Emgu.CV.runtime.ubuntu-x64

⚡ Usage

For example

1️⃣ Analyze emotion from an image URL

using AI.Facial.Emotion;

var analyzer = new EmotionAnalyzer();
var result = await analyzer.AnalyzeEmotionFromUrlAsync("https://example.com/image.jpg");

Console.WriteLine($"Emotion: {result}");

2️⃣ Analyze emotion from a Base64 image string

var base64Image = "iVBORw0KGgoAAAANSUhEUgAA...";
var result = await analyzer.AnalyzeEmotionFromBase64Async(base64Image);

Console.WriteLine($"Emotion: {result}");

3️⃣ Analyze emotion from a file stream

using var fileStream = File.OpenRead("image.jpg");
var result = await analyzer.AnalyzeEmotionFromStreamAsync(fileStream);

Console.WriteLine($"Emotion: {result}");

Example Response

{
  "emotion": "sadness"
}

📦 System Architecture (Overall Architecture, Core Components) and Data Flow Documentation

For more information about this library, you can read the System Architecture (Overall Architecture, Core Components) and Data Flow documentation here

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
25.5.16 214 5/15/2025
25.3.26 503 3/24/2025
25.3.16 176 3/16/2025
25.3.11 327 3/11/2025
25.3.4.2231 365 3/3/2025
25.3.4 358 3/3/2025
25.3.3 400 3/2/2025

25.5.16: Support from .NET 8 to .NET 10 (.NET 6 and .NET 7 is no longer supported)
25.3.26: Optimized for performance in compliance with the latest .NET 10 and C# 14.
25.3.16 Support for the newly released .NET 9 and .NET 10
25.3.11 Update the Readme
25.3.4.2231. Allow user can adjust the Target hardware like CPU, CUDA
25.3.4. Allow user can adjust the threshold, topK and nms
25.3.3. Improve the performance