-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
591 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: DocFX | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: DocFX | ||
shell: cmd | ||
run: | | ||
choco install docfx -y | ||
docfx docs\docfx.json | ||
|
||
- name: Upload DocFX packages | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docfx_site | ||
path: ${{ github.workspace }}\docs\_site | ||
|
||
- name: Publish Documentation on GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docfx/_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
############### | ||
# folder # | ||
############### | ||
/**/DROP/ | ||
/**/TEMP/ | ||
/**/packages/ | ||
/**/bin/ | ||
/**/obj/ | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$Current = $PSScriptRoot | ||
|
||
$FaceRecognitionDotNetRoot = Split-Path $Current -Parent | ||
$SourceRoot = Join-Path $FaceRecognitionDotNetRoot src | ||
$FaceRecognitionDotNetProjectRoot = Join-Path $SourceRoot FaceRecognitionDotNet | ||
|
||
docfx init -q -o docs | ||
Set-Location $Current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$Current = $PSScriptRoot | ||
|
||
$FaceRecognitionDotNetRoot = Split-Path $Current -Parent | ||
$SourceRoot = Join-Path $FaceRecognitionDotNetRoot src | ||
$FaceRecognitionDotNetProjectRoot = Join-Path $SourceRoot FaceRecognitionDotNet | ||
$DocumentDir = Join-Path $FaceRecognitionDotNetProjectRoot docfx | ||
$Json = Join-Path $Current docfx.json | ||
|
||
docfx "${Json}" --serve | ||
Set-Location $Current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
############### | ||
# temp file # | ||
############### | ||
*.yml | ||
.manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# PLACEHOLDER | ||
TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add your introductions here! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- name: Introduction | ||
href: intro.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"metadata": [ | ||
{ | ||
"src": [ | ||
{ | ||
"files": [ | ||
"**/FaceRecognitionDotNet.csproj" | ||
], | ||
"src": "../src/FaceRecognitionDotNet" | ||
} | ||
], | ||
"dest": "api", | ||
"disableGitFeatures": false, | ||
"disableDefaultFilter": false | ||
} | ||
], | ||
"build": { | ||
"content": [ | ||
{ | ||
"files": [ | ||
"api/**.yml", | ||
"api/index.md" | ||
] | ||
}, | ||
{ | ||
"files": [ | ||
"articles/**.md", | ||
"articles/**/toc.yml", | ||
"toc.yml", | ||
"*.md" | ||
] | ||
} | ||
], | ||
"resource": [ | ||
{ | ||
"files": [ | ||
"images/**" | ||
] | ||
} | ||
], | ||
"overwrite": [ | ||
{ | ||
"files": [ | ||
"apidoc/**.md" | ||
], | ||
"exclude": [ | ||
"obj/**", | ||
"_site/**" | ||
] | ||
} | ||
], | ||
"dest": "_site", | ||
"globalMetadataFiles": [], | ||
"globalMetadata": { | ||
"_appTitle": "FaceRecognitionDotNet API Document", | ||
"_appLogoPath": "images/logo.png" | ||
}, | ||
"fileMetadataFiles": [], | ||
"template": [ | ||
"default" | ||
], | ||
"postProcessors": [], | ||
"markdownEngineName": "markdig", | ||
"noLangKeyword": false, | ||
"keepFileLink": false, | ||
"cleanupCacheHistory": false, | ||
"disableGitFeatures": false | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# FaceRecognitionDotNet API Document | ||
|
||
FaceRecognitionDotNet provides simplest facial recognition api for .NET on Windows, MacOS and Linux. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# - name: Articles | ||
# href: articles/ | ||
- name: Api Documentation | ||
href: api/ | ||
# homepage: api/index.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<Authors>Takuya Takeuchi</Authors> | ||
<Description>Example of FaceRecognitionDotNet</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\FaceRecognitionDotNet\FaceRecognitionDotNet.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* This sample program is ported by C# from https://github.com/ageitgey/face_recognition/blob/master/examples/benchmark.py. | ||
*/ | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Linq; | ||
using FaceRecognitionDotNet; | ||
using Microsoft.Extensions.CommandLineUtils; | ||
|
||
namespace Benchmark | ||
{ | ||
|
||
internal class Program | ||
{ | ||
|
||
#region Methods | ||
|
||
private static void Main(string[] args) | ||
{ | ||
var app = new CommandLineApplication(false); | ||
app.Name = nameof(Benchmark); | ||
app.Description = "The program for measure face encoding performance"; | ||
app.HelpOption("-h|--help"); | ||
|
||
var modelsOption = app.Option("-m|--model", "model files directory path", CommandOptionType.SingleValue); | ||
var imageOption = app.Option("-i|--image", "target image", CommandOptionType.SingleValue); | ||
|
||
app.OnExecute(() => | ||
{ | ||
if (!modelsOption.HasValue()) | ||
{ | ||
Console.WriteLine("--model is not specified"); | ||
app.ShowHelp(); | ||
return -1; | ||
} | ||
|
||
var directory = modelsOption.Value(); | ||
if (!Directory.Exists(directory)) | ||
{ | ||
Console.WriteLine($"{directory} does not exist"); | ||
app.ShowHelp(); | ||
return -1; | ||
} | ||
|
||
var image = imageOption.Value(); | ||
if (!File.Exists(image)) | ||
{ | ||
Console.WriteLine($"{image} does not exist"); | ||
app.ShowHelp(); | ||
return -1; | ||
} | ||
|
||
using (var fr = FaceRecognition.Create(directory)) | ||
using (var im = FaceRecognition.LoadImageFile(image)) | ||
{ | ||
var locations = fr.FaceLocations(im); | ||
foreach (var l in locations) | ||
Console.WriteLine($"l: {l.Left}, t: {l.Top}, r: {l.Right}, b: {l.Bottom}"); | ||
|
||
foreach (var l in locations) | ||
{ | ||
var encodings = fr.FaceEncodings(im, new [] {l}); | ||
foreach (var e in encodings) | ||
{ | ||
Console.WriteLine($"{string.Join(", ", e.GetRawEncoding().Select(s => s.ToString()))}"); | ||
e.Dispose(); | ||
} | ||
} | ||
} | ||
|
||
return 0; | ||
}); | ||
|
||
app.Execute(args); | ||
} | ||
|
||
#endregion | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Encoding | ||
|
||
This example extract face encoding and show binary data on console. | ||
|
||
## How to use? | ||
|
||
## 1. Preparation | ||
|
||
This sample requires test image and model files. | ||
|
||
## 2. Build | ||
|
||
1. Open command prompt and change to <Encoding_dir> | ||
1. Type the following command | ||
```` | ||
$ dotnet remove reference ../../src/FaceRecognitionDotNet/DlibDotNet.csproj | ||
$ dotnet remove reference ../../src/FaceRecognitionDotNet/FaceRecognitionDotNet.csproj | ||
$ dotnet add package FaceRecognitionDotNet | ||
$ dotnet build -c Release | ||
```` | ||
|
||
## 3. Run | ||
|
||
1. Open command prompt and change to <Encoding_dir> | ||
1. Type the following sample command | ||
```` | ||
$ dotnet run -c Release -- --model models --image obama-240p.jpg | ||
l: 190, t: 32, r: 252, b: 94 | ||
-0.0858781188726425, 0.108835116028786, 0.0365724340081215, -0.0589281246066093, 0.0132484100759029, -0.00542659685015678, -0.065446712076664, -0.110336743295193, 0.19452229142189, -0.0979864299297333, 0.2352324873209, 0.0787549242377281, -0.213130414485931, -0.163164556026459, 0.0599864907562733, 0.114194087684155, -0.174584299325943, -0.0919561088085175, -0.0930094122886658, -0.117708653211594, 0.0325165763497353, -0.00997351761907339, 0.106906838715076, 0.0505531094968319, -0.144327610731125, -0.340307205915451, -0.0607180781662464, -0.188485234975815, -0.010340285487473, -0.108085952699184, -0.0919387713074684, 0.00310934125445783, -0.180108249187469, -0.124415650963783, 0.0167518854141235, -0.0189712662249804, 0.0118233505636454, -0.00810264237225056, 0.211996838450432, 0.026537474244833, -0.130677983164787, 0.0932836830615997, 0.0186070054769516, 0.207101136445999, 0.277875900268555, 0.0787801891565323, -0.00383740104734898, -0.0775237083435059, 0.126798510551453, -0.228157266974449, 0.0655233263969421, 0.155302807688713, 0.0920143350958824, 0.0186425745487213, 0.0837418735027313, -0.191329553723335, -0.00609584245830774, 0.0760508179664612, -0.14967368543148, 0.030364228412509, 0.0180820152163506, -0.0949648693203926, -0.0386509634554386, 0.0592935085296631, 0.182954981923103, 0.107051037251949, -0.113879278302193, -0.0532004535198212, 0.131714105606079, -0.0395184531807899, 0.015960929915309, 0.0232246778905392, -0.193916633725166, -0.200455144047737, -0.232742950320244, 0.0793688371777534, 0.374781519174576, 0.173277884721756, -0.211374044418335, -9.25520434975624E-05, -0.21218629181385, 0.0490190535783768, 0.0651776567101479, 0.015591973438859, -0.0640056058764458, -0.136019349098206, -0.0460829176008701, 0.0354794897139072, 0.0894847884774208, 0.0356751903891563, -0.0501493290066719, 0.225857928395271, -0.0144199710339308, 0.0671800822019577, 0.0112739009782672, 0.0495598912239075, -0.14527502655983, -0.0147501565515995, -0.158632963895798, -0.0530679523944855, 0.0203705467283726, -0.030452735722065, 0.0460555553436279, 0.145609840750694, -0.250953495502472, 0.0573373362421989, 0.00578311737626791, -0.0420315787196159, 0.0314476825296879, 0.0746812149882317, -0.0375748537480831, -0.0473008044064045, 0.0588102079927921, -0.238515302538872, 0.237175717949867, 0.259294271469116, 0.0266373176127672, 0.170270383358002, 0.0662055835127831, 0.0214092433452606, -0.000137977302074432, -0.0245289821177721, -0.163018763065338, -0.0655205324292183, 0.0550495907664299, 0.0647143721580505, 0.0707048177719116, 0.00707003846764565 | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
$targets = @( | ||
"", | ||
".CUDA111", | ||
".MKL" | ||
) | ||
|
||
$ScriptPath = $PSScriptRoot | ||
Set-Location $ScriptPath | ||
|
||
foreach ($target in $targets) | ||
{ | ||
dotnet remove reference ..\..\src\DlibDotNet\src\DlibDotNet\DlibDotNet.csproj > $null | ||
dotnet remove reference ..\..\src\FaceRecognitionDotNet\FaceRecognitionDotNet.csproj > $null | ||
dotnet add package "FaceRecognitionDotNet${target}" | ||
$image = Join-Path $ScriptPath "obama-240p.jpg" | ||
dotnet run -c Release -- --model ${env:FaceRecognitionDotNetModelDir} --image "${image}" > "FaceRecognitionDotNet${target}.log" | ||
git checkout . | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.