https://github.com/der3318/winrt-fd-sample
Notes and Samples to Use WinRT Face Detector
https://github.com/der3318/winrt-fd-sample
notes samples tutorial winrt
Last synced: about 1 year ago
JSON representation
Notes and Samples to Use WinRT Face Detector
- Host: GitHub
- URL: https://github.com/der3318/winrt-fd-sample
- Owner: der3318
- Created: 2022-11-06T14:50:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T11:58:46.000Z (over 2 years ago)
- Last Synced: 2025-01-13T18:33:37.697Z (about 1 year ago)
- Topics: notes, samples, tutorial, winrt
- Language: C++
- Homepage:
- Size: 400 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 📝 WinRT Face Detection Sample






Demonstrate the usage of [Windows.Media.FaceAnalysis.FaceDetector API](https://msdn.microsoft.com/library/windows/apps/windows.media.faceanalysis.facedetector.aspx). The repo provides basic samples for C++ (WRL), python and rust, in addition to the official [C#, cppwinrt](https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/BasicFaceDetection), [C++/CX and VB](https://github.com/microsoft/Windows-universal-samples/tree/main/archived/BasicFaceDetection) guidance.
### 1️⃣ Windows Runtime C++ Template Lib (WRL) Console App
Folder [cppwrl/](https://github.com/der3318/winrt-fd-sample/tree/main/cppwrl) is a Visual Studio 2022 solution to build a x86/x64 console app:

It detects faces in picture [cppwrl/SampleInput.jpg](https://github.com/der3318/winrt-fd-sample/blob/main/cppwrl/SampleInput.jpg) and print the bounding box via stdout.
### 2️⃣ Python Script
Python script and its dependency are available under folder [python/](https://github.com/der3318/winrt-fd-sample/tree/main/python):

Use `pip3 install -r requirements.txt` to install libs, and run `python3 detect.py` to [dump](https://github.com/Textualize/rich#rich-inspect) the detection info of image [python/face.jpg](https://github.com/der3318/winrt-fd-sample/blob/main/python/face.jpg).
### 3️⃣ Rust Cargo Windows Binary Project
Directory [rust/](https://github.com/der3318/winrt-fd-sample/tree/main/rust) is a Cargo package project to build a windows exe application. Follow [learn.microsoft.com's](https://learn.microsoft.com/en-us/windows/dev-environment/rust/setup) instructions to setup rust on Windows with MSVC build tools.

Simply run `cargo run` to compile and find faces from the sample input [rust/face.jpg](https://github.com/der3318/winrt-fd-sample/blob/main/rust/face.jpg). Results will be output to the console directly.