pock-programming.FaceONNXSkiasharp
0.1.2
dotnet add package pock-programming.FaceONNXSkiasharp --version 0.1.2
NuGet\Install-Package pock-programming.FaceONNXSkiasharp -Version 0.1.2
<PackageReference Include="pock-programming.FaceONNXSkiasharp" Version="0.1.2" />
<PackageVersion Include="pock-programming.FaceONNXSkiasharp" Version="0.1.2" />
<PackageReference Include="pock-programming.FaceONNXSkiasharp" />
paket add pock-programming.FaceONNXSkiasharp --version 0.1.2
#r "nuget: pock-programming.FaceONNXSkiasharp, 0.1.2"
#:package pock-programming.FaceONNXSkiasharp@0.1.2
#addin nuget:?package=pock-programming.FaceONNXSkiasharp&version=0.1.2
#tool nuget:?package=pock-programming.FaceONNXSkiasharp&version=0.1.2
FaceONNX ๐ค
Lightweight .NET 10 face detection library based on ONNX Runtime and SkiaSharp.
Projects ๐ฆ
FaceONNX: core libraryFaceONNX.Samples: console sample app (images/โresults/)
Quick start ๐
cd FaceONNX.Samples
dotnet run
Installation ๐ฅ
From NuGet Package
dotnet add package pock-programming.FaceONNXSkiasharp
Or via Package Manager:
Install-Package pock-programming.FaceONNXSkiasharp
Model Deployment
When you install this package via NuGet:
- ONNX models are automatically included in the package as content files
- Models are automatically copied to your project's output directory (
bin\Debug\net10.0\Models\or equivalent) - Model resolution is handled automatically by the
FaceDetectorclass
Supported frameworks: .NET 10+
Usage ๐งฉ
using FaceONNX;
using SkiaSharp;
using var detector = new FaceDetector(model: FaceDetectorModel.Yolov5);
using var bitmap = SKBitmap.Decode("images/group.jpg");
FaceDetectionResult[] detections = detector.ForwardDetection(bitmap);
SKRectI[] boxes = detector.Forward(bitmap);
var roi = new SKRectI(100, 80, 500, 420);
FaceDetectionResult[] roiDetections = detector.ForwardDetection(bitmap, roi, clamp: true);
Model selection ๐ง
// Default
using var yolov5Detector = new FaceDetector(model: FaceDetectorModel.Yolov5);
using var yolo26Detector = new FaceDetector(model: FaceDetectorModel.Yolo26);
using var faceOnnxDetector = new FaceDetector(model: FaceDetectorModel.FaceOnnx);
| Model enum | ONNX file | Model size | Output | Landmarks |
|---|---|---|---|---|
FaceDetectorModel.Yolov5 |
yolov5s-face.onnx |
29.3 MB | Single YOLOv5-style tensor | Yes (5-point) |
FaceDetectorModel.Yolo26 |
yolo26_face_fp16.onnx |
18.3 MB | Single YOLO tensor (xyxy + confidence + class) |
No |
FaceDetectorModel.FaceOnnx |
face_detector_640.onnx |
1.5 MB | Split outputs (confidences + boxes) |
No |
API summary ๐ ๏ธ
Forward(...)returnsSKRectI[]ForwardDetection(...)returnsFaceDetectionResult[]- ROI overloads:
Forward(image, rectangle, clamp)andForwardDetection(image, rectangle, clamp) - Raw float-channel overloads:
Forward(float[][,])andForwardDetection(float[][,])(CHW, 0โ255 range) - Thresholds:
detectionThreshold,confidenceThreshold,nmsThreshold - Default model:
FaceDetectorModel.Yolov5
Attribution and licenses ๐
FaceONNX model (face_detector_640.onnx) ๐งพ
Source:
- https://github.com/arieffauzi-st/FaceONNX
- https://github.com/arieffauzi-st/FaceONNX/blob/main/FaceONNX/Models/face_detector_640.onnx
Thanks to arieffauzi-st for maintaining and sharing this FaceONNX fork.
License status in source repo:
- no root
LICENSEfile - no model-specific license/notice file in
FaceONNX/Models
Reference:
YOLOv5 model and related integration code ๐ค
Source:
Thanks to the FaceONNX maintainers and contributors for publishing the models and implementation details used by this project.
License:
- MIT
- Copyright (c) 2020-2025 Valery Asiryan
- base models: Ultralytics YOLOv5 (AGPL-3.0, or Ultralytics Enterprise License)
Reference:
- https://github.com/FaceONNX/FaceONNX/blob/main/LICENSE
- https://github.com/FaceONNX/FaceONNX.Models/blob/main/LICENSE
YOLO26 model (yolo26_face_fp16.onnx) ๐
Source:
License details from source repo:
- training code: MIT
- base models: Ultralytics YOLO26 (AGPL-3.0, or Ultralytics Enterprise License)
- dataset terms: WiderFace terms
Reference:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.ML.OnnxRuntime (>= 1.29.0)
- SkiaSharp (>= 4.151.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.