Showing preview only (524K chars total). Download the full file or copy to clipboard to get everything.
Repository: Microsoft/Cognitive-Face-Windows
Branch: master
Commit: a8e0448d1ee7
Files: 70
Total size: 499.0 KB
Directory structure:
gitextract_vv6euq7q/
├── .gitignore
├── .gitmodules
├── CONTRIBUTING.md
├── ClientLibrary/
│ ├── 35MSSharedLib1024.snk
│ ├── Contract/
│ │ ├── Accessory.cs
│ │ ├── AddPersistedFaceResult.cs
│ │ ├── Blur.cs
│ │ ├── Candidate.cs
│ │ ├── ClientError.cs
│ │ ├── CreatePersonResult.cs
│ │ ├── Exposure.cs
│ │ ├── Face.cs
│ │ ├── FaceAttributes.cs
│ │ ├── FaceLandmarks.cs
│ │ ├── FaceList.cs
│ │ ├── FaceListMetadata.cs
│ │ ├── FaceMetadata.cs
│ │ ├── FaceRectangle.cs
│ │ ├── FacialHair.cs
│ │ ├── FeatureCoordinate.cs
│ │ ├── GlassesTypes.cs
│ │ ├── GroupResult.cs
│ │ ├── Hair.cs
│ │ ├── HeadPose.cs
│ │ ├── IdentifyResult.cs
│ │ ├── LargeFaceList.cs
│ │ ├── LargePersonGroup.cs
│ │ ├── Makeup.cs
│ │ ├── Noise.cs
│ │ ├── Occlusion.cs
│ │ ├── PersistedFace.cs
│ │ ├── Person.cs
│ │ ├── PersonGroup.cs
│ │ ├── SimilarFace.cs
│ │ ├── SimilarPersistedFace.cs
│ │ ├── TrainingStatus.cs
│ │ └── VerifyResult.cs
│ ├── FaceAPIException.cs
│ ├── FaceClientSDK.nuspec
│ ├── FaceServiceClient.cs
│ ├── IFaceServiceClient.cs
│ ├── Microsoft.ProjectOxford.Face.csproj
│ ├── Microsoft.ProjectOxford.Face.sln
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── LICENSE-IMAGE.md
├── LICENSE.md
├── README.md
├── Sample-WPF/
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Controls/
│ │ ├── Face.cs
│ │ ├── FaceDetectionPage.xaml
│ │ ├── FaceDetectionPage.xaml.cs
│ │ ├── FaceFindSimilarPage.xaml
│ │ ├── FaceFindSimilarPage.xaml.cs
│ │ ├── FaceGroupingPage.xaml
│ │ ├── FaceGroupingPage.xaml.cs
│ │ ├── FaceIdentificationPage.xaml
│ │ ├── FaceIdentificationPage.xaml.cs
│ │ ├── FaceVerificationPage.xaml
│ │ ├── FaceVerificationPage.xaml.cs
│ │ └── UIHelper.cs
│ ├── FaceAPI-WPF-Samples.csproj
│ ├── FaceAPI-WPF-Samples.sln
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ └── packages.config
└── ThirdPartyNotices.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
================================================
FILE: .gitmodules
================================================
[submodule "Cognitive-Common-Windows"]
path = Cognitive-Common-Windows
url = https://github.com/Microsoft/Cognitive-Common-Windows.git
================================================
FILE: CONTRIBUTING.md
================================================
Contributing to Microsoft Cognitive Services Client Libraries & Samples
===============================================
So, you want to contribute on a client library or sample for one of the Microsoft Cognitive Services.
Here's what you need to know.
1. Each SDK should include both a client library and a sample showing the API in
action
2. When working on an SDK, it's important that we are consistent from project to project, so we ask you to follow the coding guidelines below:
- Windows [(Coding guidelines for C#)](https://msdn.microsoft.com/en-us/library/ff926074.aspx) -- also reference our [common Windows code](https://github.com/Microsoft/Cognitive-common-windows) for building samples
- Android [(Coding guidelines for
Java)](<http://source.android.com/source/code-style.html>)
- iOS Objective-C [(Coding guidelines for
Cocoa)](<https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html>)
- Optional: Client Javascript ([Coding guidelines for
npm](<https://docs.npmjs.com/misc/coding-style>))
3. Samples are important for illustrating how to actually call into the API.
Samples should be as visual and reusable as possible.
- Do:
- Create a UI sample when possible.
- Make your sample user friendly. Expect that developers will want to try
different mainline scenarios and key APIs.
- Create code that's easy for other developers to copy/paste into their
own solutions
- Consider:
- Adding UI to allow devs to quickly copy/paste subscription keys, instead
of updating them in the code or using a config file. The
FaceAPI-WPF-Samples.sln provides an example.
- Don't:
- Leave your subscription key in the source of samples. You do not want your key to be abused by others.
Happy coding!
================================================
FILE: ClientLibrary/Contract/Accessory.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// Accessory type
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum AccessoryType
{
/// <summary>
/// Headwear
/// </summary>
Headwear,
/// <summary>
/// Glasses
/// </summary>
Glasses,
/// <summary>
/// Mask
/// </summary>
Mask
}
/// <summary>
/// Face accessory class contains accessory information
/// </summary>
public class Accessory
{
#region Properties
/// <summary>
/// Indicating the accessory type
/// </summary>
public AccessoryType Type
{
get; set;
}
/// <summary>
/// Indicating the confidence for accessory type
/// </summary>
public double Confidence
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/AddPersistedFaceResult.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Represents face stored in FaceList or Person
/// </summary>
public class AddPersistedFaceResult
{
#region Properties
/// <summary>
/// Gets or sets the persisted face identifier.
/// </summary>
/// <value>
/// The persisted face identifier.
/// </value>
public Guid PersistedFaceId
{
get;
set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Blur.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// Definition of blur level
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum BlurLevel
{
/// <summary>
/// Low blur level indicating a clear face image
/// </summary>
Low,
/// <summary>
/// Medium blur level indicating a slightly blurry face image
/// </summary>
Medium,
/// <summary>
/// High blur level indicating a extremely blurry face image
/// </summary>
High
}
/// <summary>
/// Face Blur class contains blur information
/// </summary>
public class Blur
{
#region Properties
/// <summary>
/// Indicating the blur level of face image
/// </summary>
public BlurLevel BlurLevel
{
get; set;
}
/// <summary>
/// Blur value is in range [0, 1]. Larger value means the face image is more blurry.
/// [0, 0.25) is low blur level.
/// [0.25, 0.75) is medium blur level.
/// [0.75, 1] is high blur level.
/// </summary>
public double Value
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Candidate.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The identified candidate entity.
/// </summary>
public class Candidate
{
#region Properties
/// <summary>
/// Gets or sets the person identifier.
/// </summary>
/// <value>
/// The person identifier.
/// </value>
public Guid PersonId
{
get;
set;
}
/// <summary>
/// Gets or sets the confidence.
/// </summary>
/// <value>
/// The confidence.
/// </value>
public double Confidence
{
get;
set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/ClientError.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.Serialization;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Represents client error with detailed error message and error code
/// </summary>
[DataContract]
public class ClientError
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ClientError" /> class
/// </summary>
public ClientError()
{
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets or sets the detailed error message and error code
/// </summary>
[DataMember(Name = "error")]
public ClientExceptionMessage Error
{
get;
set;
}
#endregion Properties
}
/// <summary>
/// Represents detailed error message and error code
/// </summary>
[DataContract]
public class ClientExceptionMessage
{
#region Properties
/// <summary>
/// Gets or sets the detailed error code
/// </summary>
[DataMember(Name = "code")]
public string ErrorCode
{
get;
set;
}
/// <summary>
/// Gets or sets the detailed error message
/// </summary>
[DataMember(Name = "message")]
public string Message
{
get;
set;
}
#endregion Properties
}
/// <summary>
/// Represents client error with detailed error message and error code
/// </summary>
[DataContract]
public class ServiceError
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ServiceError" /> class
/// </summary>
public ServiceError()
{
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets or sets the detailed error message and error code
/// </summary>
[DataMember(Name = "statusCode")]
public string ErrorCode
{
get;
set;
}
/// <summary>
/// Gets or sets the detailed error message and error code
/// </summary>
[DataMember(Name = "message")]
public string Message
{
get;
set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/CreatePersonResult.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The class for person creation result.
/// </summary>
public class CreatePersonResult
{
#region Properties
/// <summary>
/// Gets or sets the person identifier.
/// </summary>
/// <value>
/// The person identifier.
/// </value>
public Guid PersonId
{
get;
set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Exposure.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// Definition of exposure level
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ExposureLevel
{
/// <summary>
/// Indicating face image is in under exposure
/// </summary>
UnderExposure,
/// <summary>
/// Indicating face image is in good exposure
/// </summary>
GoodExposure,
/// <summary>
/// Indicating face image is in over exposure
/// </summary>
OverExposure
}
/// <summary>
/// Face Exposure class contains exposure information
/// </summary>
public class Exposure
{
#region Properties
/// <summary>
/// Indicating exposure level of face image
/// </summary>
public ExposureLevel ExposureLevel
{
get; set;
}
/// <summary>
/// Exposure value is in range [0, 1]. Larger value means the face image is more brighter.
/// [0, 0.25) is under exposure.
/// [0.25, 0.75) is good exposure.
/// [0.75, 1] is over exposure.
/// </summary>
public double Value
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Face.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The detected face entity.
/// </summary>
public class Face
{
#region Properties
/// <summary>
/// Gets or sets the face identifier.
/// </summary>
/// <value>
/// The face identifier.
/// </value>
public Guid FaceId
{
get;
set;
}
/// <summary>
/// Gets or sets the face rectangle.
/// </summary>
/// <value>
/// The face rectangle.
/// </value>
public FaceRectangle FaceRectangle
{
get;
set;
}
/// <summary>
/// Gets or sets the face landmarks.
/// </summary>
/// <value>
/// The face landmarks.
/// </value>
public FaceLandmarks FaceLandmarks
{
get;
set;
}
/// <summary>
/// Gets or sets the face attributes.
/// </summary>
/// <value>
/// The face attributes.
/// </value>
public FaceAttributes FaceAttributes
{
get;
set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FaceAttributes.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Microsoft.ProjectOxford.Face.Contract
{
using Microsoft.ProjectOxford.Common.Contract;
/// <summary>
/// The face attributes class that holds Age/Gender/Head Pose/Smile/Facial Hair information.
/// </summary>
public class FaceAttributes
{
#region Properties
/// <summary>
/// Gets or sets the age value.
/// </summary>
/// <value>
/// The age value.
/// </value>
public double Age
{
get; set;
}
/// <summary>
/// Gets or sets the gender.
/// </summary>
/// <value>
/// The gender.
/// </value>
public string Gender
{
get; set;
}
/// <summary>
/// Gets or sets the head pose.
/// </summary>
/// <value>
/// The head pose.
/// </value>
public HeadPose HeadPose
{
get; set;
}
/// <summary>
/// Gets or sets the smile value. Represents the confidence of face is smiling.
/// </summary>
/// <value>
/// The smile value.
/// </value>
public double Smile
{
get; set;
}
/// <summary>
/// Gets or sets the facial hair.
/// </summary>
/// <value>
/// The facial hair.
/// </value>
public FacialHair FacialHair
{
get; set;
}
/// <summary>
/// Gets or sets the emotion.
/// </summary>
/// <value>
/// The emotion.
/// </value>
public EmotionScores Emotion
{
get; set;
}
/// <summary>
/// Gets or sets the glasses type.
/// </summary>
/// <value>
/// The glasses type.
/// </value>
[JsonConverter(typeof(StringEnumConverter))]
public Glasses Glasses
{
get; set;
}
/// <summary>
/// Gets or sets the blur
/// </summary>
/// <value>
/// The blur type
/// </value>
public Blur Blur
{
get; set;
}
/// <summary>
/// Gets or sets the exposure
/// </summary>
/// <value>
/// The exposure type
/// </value>
public Exposure Exposure
{
get; set;
}
/// <summary>
/// Gets or sets the noise
/// </summary>
/// <value>
/// The noise type
/// </value>
public Noise Noise
{
get; set;
}
/// <summary>
/// Gets or sets the makeup
/// </summary>
/// <value>
/// The makeup type
/// </value>
public Makeup Makeup
{
get; set;
}
/// <summary>
/// Gets or sets the accessories
/// </summary>
/// <value>
/// The accessory type array
/// </value>
public Accessory[] Accessories
{
get; set;
}
/// <summary>
/// Gets or sets the occlusion
/// </summary>
/// <value>
/// The occlusion type
/// </value>
public Occlusion Occlusion
{
get; set;
}
/// <summary>
/// Gets or sets the hair
/// </summary>
/// <value>
/// The hair type
/// </value>
public Hair Hair
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FaceLandmarks.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The face landmarks class.
/// </summary>
public class FaceLandmarks
{
#region Properties
/// <summary>
/// Gets or sets the pupil left.
/// </summary>
/// <value>
/// The pupil left.
/// </value>
public FeatureCoordinate PupilLeft
{
get; set;
}
/// <summary>
/// Gets or sets the pupil right.
/// </summary>
/// <value>
/// The pupil right.
/// </value>
public FeatureCoordinate PupilRight
{
get; set;
}
/// <summary>
/// Gets or sets the nose tip.
/// </summary>
/// <value>
/// The nose tip.
/// </value>
public FeatureCoordinate NoseTip
{
get; set;
}
/// <summary>
/// Gets or sets the mouth left.
/// </summary>
/// <value>
/// The mouth left.
/// </value>
public FeatureCoordinate MouthLeft
{
get; set;
}
/// <summary>
/// Gets or sets the mouth right.
/// </summary>
/// <value>
/// The mouth right.
/// </value>
public FeatureCoordinate MouthRight
{
get; set;
}
/// <summary>
/// Gets or sets the eyebrow left outer.
/// </summary>
/// <value>
/// The eyebrow left outer.
/// </value>
public FeatureCoordinate EyebrowLeftOuter
{
get; set;
}
/// <summary>
/// Gets or sets the eyebrow left inner.
/// </summary>
/// <value>
/// The eyebrow left inner.
/// </value>
public FeatureCoordinate EyebrowLeftInner
{
get; set;
}
/// <summary>
/// Gets or sets the eye left outer.
/// </summary>
/// <value>
/// The eye left outer.
/// </value>
public FeatureCoordinate EyeLeftOuter
{
get; set;
}
/// <summary>
/// Gets or sets the eye left top.
/// </summary>
/// <value>
/// The eye left top.
/// </value>
public FeatureCoordinate EyeLeftTop
{
get; set;
}
/// <summary>
/// Gets or sets the eye left bottom.
/// </summary>
/// <value>
/// The eye left bottom.
/// </value>
public FeatureCoordinate EyeLeftBottom
{
get; set;
}
/// <summary>
/// Gets or sets the eye left inner.
/// </summary>
/// <value>
/// The eye left inner.
/// </value>
public FeatureCoordinate EyeLeftInner
{
get; set;
}
/// <summary>
/// Gets or sets the eyebrow right inner.
/// </summary>
/// <value>
/// The eyebrow right inner.
/// </value>
public FeatureCoordinate EyebrowRightInner
{
get; set;
}
/// <summary>
/// Gets or sets the eyebrow right outer.
/// </summary>
/// <value>
/// The eyebrow right outer.
/// </value>
public FeatureCoordinate EyebrowRightOuter
{
get; set;
}
/// <summary>
/// Gets or sets the eye right inner.
/// </summary>
/// <value>
/// The eye right inner.
/// </value>
public FeatureCoordinate EyeRightInner
{
get; set;
}
/// <summary>
/// Gets or sets the eye right top.
/// </summary>
/// <value>
/// The eye right top.
/// </value>
public FeatureCoordinate EyeRightTop
{
get; set;
}
/// <summary>
/// Gets or sets the eye right bottom.
/// </summary>
/// <value>
/// The eye right bottom.
/// </value>
public FeatureCoordinate EyeRightBottom
{
get; set;
}
/// <summary>
/// Gets or sets the eye right outer.
/// </summary>
/// <value>
/// The eye right outer.
/// </value>
public FeatureCoordinate EyeRightOuter
{
get; set;
}
/// <summary>
/// Gets or sets the nose root left.
/// </summary>
/// <value>
/// The nose root left.
/// </value>
public FeatureCoordinate NoseRootLeft
{
get; set;
}
/// <summary>
/// Gets or sets the nose root right.
/// </summary>
/// <value>
/// The nose root right.
/// </value>
public FeatureCoordinate NoseRootRight
{
get; set;
}
/// <summary>
/// Gets or sets the nose left alar top.
/// </summary>
/// <value>
/// The nose left alar top.
/// </value>
public FeatureCoordinate NoseLeftAlarTop
{
get; set;
}
/// <summary>
/// Gets or sets the nose right alar top.
/// </summary>
/// <value>
/// The nose right alar top.
/// </value>
public FeatureCoordinate NoseRightAlarTop
{
get; set;
}
/// <summary>
/// Gets or sets the nose left alar out tip.
/// </summary>
/// <value>
/// The nose left alar out tip.
/// </value>
public FeatureCoordinate NoseLeftAlarOutTip
{
get; set;
}
/// <summary>
/// Gets or sets the nose right alar out tip.
/// </summary>
/// <value>
/// The nose right alar out tip.
/// </value>
public FeatureCoordinate NoseRightAlarOutTip
{
get; set;
}
/// <summary>
/// Gets or sets the upper lip top.
/// </summary>
/// <value>
/// The upper lip top.
/// </value>
public FeatureCoordinate UpperLipTop
{
get; set;
}
/// <summary>
/// Gets or sets the upper lip bottom.
/// </summary>
/// <value>
/// The upper lip bottom.
/// </value>
public FeatureCoordinate UpperLipBottom
{
get; set;
}
/// <summary>
/// Gets or sets the under lip top.
/// </summary>
/// <value>
/// The under lip top.
/// </value>
public FeatureCoordinate UnderLipTop
{
get; set;
}
/// <summary>
/// Gets or sets the under lip bottom.
/// </summary>
/// <value>
/// The under lip bottom.
/// </value>
public FeatureCoordinate UnderLipBottom
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FaceList.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The face list class
/// </summary>
public class FaceList : FaceListMetadata
{
#region Properties
/// <summary>
/// Gets or sets the persisted faces.
/// </summary>
/// <value>
/// The persisted faces.
/// </value>
public PersistedFace[] PersistedFaces
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FaceListMetadata.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The face list metadata class.
/// </summary>
public class FaceListMetadata
{
#region Properties
/// <summary>
/// Gets or sets the face list identifier.
/// </summary>
/// <value>
/// The face list identifier.
/// </value>
public string FaceListId
{
get; set;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name
{
get; set;
}
/// <summary>
/// Gets or sets the user data.
/// </summary>
/// <value>
/// The user data.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FaceMetadata.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Face metadata class.
/// </summary>
public class FaceMetadata
{
#region Properties
/// <summary>
/// Gets or sets the face identifier.
/// </summary>
/// <value>
/// The face identifier.
/// </value>
public Guid FaceId
{
get; set;
}
/// <summary>
/// Gets or sets the user data.
/// </summary>
/// <value>
/// The user data.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FaceRectangle.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The face rectangle entity.
/// </summary>
public class FaceRectangle
{
#region Properties
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>
/// The width.
/// </value>
public int Width
{
get; set;
}
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>
/// The height.
/// </value>
public int Height
{
get; set;
}
/// <summary>
/// Gets or sets the left.
/// </summary>
/// <value>
/// The left of the face rectangle.
/// </value>
public int Left
{
get; set;
}
/// <summary>
/// Gets or sets the top.
/// </summary>
/// <value>
/// The top of the face rectangle.
/// </value>
public int Top
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FacialHair.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Represents length of moustache, beard and sideburn
/// </summary>
public class FacialHair
{
#region Properties
/// <summary>
/// Gets or sets the moustache value. Represents the length of moustache.
/// </summary>
/// <value>
/// The moustache value.
/// </value>
public double Moustache
{
get; set;
}
/// <summary>
/// Gets or sets the beard value. Represents the length of beard.
/// </summary>
/// <value>
/// The beard value.
/// </value>
public double Beard
{
get; set;
}
/// <summary>
/// Gets or sets the sideburns value. Represents the length of sideburns.
/// </summary>
/// <value>
/// The sideburns value.
/// </value>
public double Sideburns
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/FeatureCoordinate.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The class for feature coordinate.
/// </summary>
public class FeatureCoordinate
{
#region Properties
/// <summary>
/// Gets or sets the x in pixel.
/// </summary>
/// <value>
/// The x of the feature coordinate.
/// </value>
public double X
{
get; set;
}
/// <summary>
/// Gets or sets the y in pixel.
/// </summary>
/// <value>
/// The y of the feature coordinate.
/// </value>
public double Y
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/GlassesTypes.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows/
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Enumeration which represents the type of wearing glasses
/// </summary>
public enum Glasses
{
/// <summary>
/// Indicates not wearing any glasses
/// </summary>
NoGlasses,
/// <summary>
/// Indicates wearing sunglasses
/// </summary>
Sunglasses,
/// <summary>
/// Indicates wearing reading glasses
/// </summary>
ReadingGlasses,
/// <summary>
/// Indicates wearing swimming goggles
/// </summary>
SwimmingGoggles
}
}
================================================
FILE: ClientLibrary/Contract/GroupResult.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The class for group result.
/// </summary>
public class GroupResult
{
#region Properties
/// <summary>
/// Gets or sets the groups. The groups are ranked by number of faces.
/// </summary>
/// <value>
/// The groups.
/// </value>
public List<Guid[]> Groups
{
get; set;
}
/// <summary>
/// Gets or sets the messy group. Messy group contains all the faces which cannot find any similar faces from original faces.
/// </summary>
/// <value>
/// The messy group.
/// </value>
public Guid[] MessyGroup
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Hair.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// Hair color type
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum HairColorType
{
/// <summary>
/// unknown
/// </summary>
Unknown,
/// <summary>
/// White
/// </summary>
White,
/// <summary>
/// Gray
/// </summary>
Gray,
/// <summary>
/// Blond
/// </summary>
Blond,
/// <summary>
/// Brown
/// </summary>
Brown,
/// <summary>
/// Red
/// </summary>
Red,
/// <summary>
/// Black
/// </summary>
Black,
/// <summary>
/// Other
/// </summary>
Other
}
/// <summary>
/// Face HiarColor class contains hair color information
/// </summary>
public class HairColor
{
/// <summary>
/// Indicating the hair color type
/// </summary>
public HairColorType Color
{
get; set;
}
/// <summary>
/// Indicating the confidence for hair color type
/// </summary>
public double Confidence
{
get; set;
}
}
/// <summary>
/// Face Hair class contains hair information
/// </summary>
public class Hair
{
#region Properties
/// <summary>
/// Indicating the confidence of a bald head
/// </summary>
public double Bald
{
get; set;
}
/// <summary>
/// Indicating whether hair is occluded or not
/// </summary>
public bool Invisible
{
get; set;
}
/// <summary>
/// Indicating all possible hair colors with confidences
/// </summary>
public HairColor[] HairColor
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/HeadPose.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The head pose entity.
/// </summary>
public class HeadPose
{
#region Properties
/// <summary>
/// Gets or sets the roll.
/// </summary>
/// <value>
/// The roll of the face pose.
/// </value>
public double Roll
{
get; set;
}
/// <summary>
/// Gets or sets the yaw.
/// </summary>
/// <value>
/// The yaw of the face pose.
/// </value>
public double Yaw
{
get; set;
}
/// <summary>
/// Gets or sets the pitch.
/// </summary>
/// <value>
/// The pitch of the face pose.
/// </value>
public double Pitch
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/IdentifyResult.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The identification result.
/// </summary>
public class IdentifyResult
{
#region Properties
/// <summary>
/// Gets or sets the face identifier.
/// </summary>
/// <value>
/// The face identifier.
/// </value>
public Guid FaceId
{
get; set;
}
/// <summary>
/// Gets or sets the candidates.
/// </summary>
/// <value>
/// The candidates.
/// </value>
public Candidate[] Candidates
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/LargeFaceList.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The large face list class.
/// </summary>
public class LargeFaceList
{
#region Properties
/// <summary>
/// Gets or sets the large face list identifier.
/// </summary>
/// <value>
/// The large face list identifier.
/// </value>
public string LargeFaceListId
{
get; set;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name
{
get; set;
}
/// <summary>
/// Gets or sets the user data.
/// </summary>
/// <value>
/// The user data.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/LargePersonGroup.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The large person group entity.
/// </summary>
public class LargePersonGroup
{
#region Properties
/// <summary>
/// Gets or sets the large person group identifier.
/// </summary>
/// <value>
/// The large person group identifier.
/// </value>
public string LargePersonGroupId
{
get; set;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name of the large person group.
/// </value>
public string Name
{
get; set;
}
/// <summary>
/// Gets or sets the user data.
/// </summary>
/// <value>
/// The user data.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Makeup.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Face Makeup class contains makeup information
/// </summary>
public class Makeup
{
#region Properties
/// <summary>
/// Indicating whether eye has makeup or not
/// </summary>
public bool EyeMakeup
{
get; set;
}
/// <summary>
/// Indicating whether lip has makeup or not
/// </summary>
public bool LipMakeup
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Noise.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// Definition of noise level
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum NoiseLevel
{
/// <summary>
/// Low noise level indicating a clear face image
/// </summary>
Low,
/// <summary>
/// Medium noise level indicating a slightly noisy face image
/// </summary>
Medium,
/// <summary>
/// High noise level indicating a extremely noisy face image
/// </summary>
High
}
/// <summary>
/// Face Noise class contains noise information
/// </summary>
public class Noise
{
#region Properties
/// <summary>
/// Indicating noise level of face image
/// </summary>
public NoiseLevel NoiseLevel
{
get; set;
}
/// <summary>
/// Noise value is in range [0, 1]. Larger value means the face image is more noisy.
/// [0, 0.3) is low noise level.
/// [0.3, 0.7) is medium noise level.
/// [0.7, 1] is high noise level.
/// </summary>
public double Value
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Occlusion.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// Face Occlusion class contains occlusion information
/// </summary>
public class Occlusion
{
#region Properties
/// <summary>
/// Indicating whether forehead is occluded or not
/// </summary>
public bool ForeheadOccluded
{
get; set;
}
/// <summary>
/// Indicating whether eye is occluded or not
/// </summary>
public bool EyeOccluded
{
get; set;
}
/// <summary>
/// Indicating whether mouth is occluded or not
/// </summary>
public bool MouthOccluded
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/PersistedFace.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The persisted face entity.
/// </summary>
public class PersistedFace
{
#region Properties
/// <summary>
/// Gets or sets the persisted face identifier.
/// </summary>
/// <value>
/// The persisted face identifier.
/// </value>
public Guid PersistedFaceId
{
get;
set;
}
/// <summary>
/// Gets or sets the user data.
/// </summary>
/// <value>
/// The user data.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/Person.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The person entity.
/// </summary>
public class Person
{
#region Properties
/// <summary>
/// Gets or sets the person identifier.
/// </summary>
/// <value>
/// The person identifier.
/// </value>
public Guid PersonId
{
get; set;
}
/// <summary>
/// Gets or sets the persisted face ids.
/// </summary>
/// <value>
/// The persisted face ids.
/// </value>
public Guid[] PersistedFaceIds
{
get; set;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name of the person.
/// </value>
public string Name
{
get; set;
}
/// <summary>
/// Gets or sets the profile.
/// </summary>
/// <value>
/// The profile.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/PersonGroup.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The person group entity.
/// </summary>
public class PersonGroup
{
#region Properties
/// <summary>
/// Gets or sets the person group identifier.
/// </summary>
/// <value>
/// The person group identifier.
/// </value>
public string PersonGroupId
{
get; set;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name of the person group.
/// </value>
public string Name
{
get; set;
}
/// <summary>
/// Gets or sets the user data.
/// </summary>
/// <value>
/// The user data.
/// </value>
public string UserData
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/SimilarFace.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The class for similar face.
/// </summary>
public class SimilarFace
{
#region Properties
/// <summary>
/// Gets or sets the face identifier.
/// </summary>
/// <value>
/// The face identifier.
/// </value>
public Guid FaceId
{
get; set;
}
/// <summary>
/// Gets or sets the confidence.
/// </summary>
/// <value>
/// The confidence.
/// </value>
public double Confidence
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/SimilarPersistedFace.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The class for similar persisted face.
/// </summary>
public class SimilarPersistedFace
{
#region Properties
/// <summary>
/// Gets or sets the persisted face identifier.
/// </summary>
/// <value>
/// The persisted face identifier.
/// </value>
public Guid PersistedFaceId
{
get; set;
}
/// <summary>
/// Gets or sets the confidence value.
/// </summary>
/// <value>
/// The confidence value.
/// </value>
public double Confidence
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/TrainingStatus.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace Microsoft.ProjectOxford.Face.Contract
{
#region Enumerations
/// <summary>
/// Enumeration represents status of training
/// </summary>
public enum Status
{
/// <summary>
/// Training succeeded
/// </summary>
Succeeded,
/// <summary>
/// Training failed
/// </summary>
Failed,
/// <summary>
/// Training still in progress
/// </summary>
Running
}
#endregion Enumerations
/// <summary>
/// The training status entity.
/// </summary>
public class TrainingStatus
{
#region Properties
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>
/// The status.
/// </value>
public Status Status
{
get; set;
}
/// <summary>
/// Gets or sets the create time.
/// </summary>
/// <value>
/// The create time.
/// </value>
public DateTime CreatedDateTime
{
get; set;
}
/// <summary>
/// Gets or sets the last action time.
/// </summary>
/// <value>
/// The last action time.
/// </value>
public DateTime LastActionDateTime
{
get; set;
}
/// <summary>
/// Gets or sets the last successful training time.
/// </summary>
/// <value>
/// The last successful training time.
/// </value>
public DateTime? LastSuccessfulTrainingDateTime
{
get; set;
}
/// <summary>
/// Gets or sets the message.
/// </summary>
/// <value>
/// The message.
/// </value>
public string Message
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/Contract/VerifyResult.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace Microsoft.ProjectOxford.Face.Contract
{
/// <summary>
/// The verify result entity.
/// </summary>
public class VerifyResult
{
#region Properties
/// <summary>
/// Gets or sets a value indicating whether this instance is same.
/// </summary>
/// <value>
/// <c>true</c> if this instance is same; otherwise, <c>false</c>.
/// </value>
public bool IsIdentical
{
get; set;
}
/// <summary>
/// Gets or sets the confidence.
/// </summary>
/// <value>
/// The confidence.
/// </value>
public double Confidence
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/FaceAPIException.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Net;
namespace Microsoft.ProjectOxford.Face
{
/// <summary>
/// Represents client error with detailed error message and error code
/// </summary>
public class FaceAPIException : Exception
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="FaceAPIException" /> class
/// </summary>
public FaceAPIException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FaceAPIException" /> class
/// </summary>
/// <param name="errorCode">Code represents the error category</param>
/// <param name="errorMessage">Message represents the detailed error description</param>
/// <param name="statusCode">Http status code</param>
public FaceAPIException(string errorCode, string errorMessage, HttpStatusCode statusCode)
: base(errorMessage + "(" + errorCode + ")")
{
this.ErrorCode = errorCode;
this.ErrorMessage = errorMessage;
this.HttpStatus = statusCode;
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets or sets the error code
/// </summary>
public string ErrorCode
{
get; set;
}
/// <summary>
/// Gets or sets the error message
/// </summary>
public string ErrorMessage
{
get; set;
}
/// <summary>
/// Gets or sets http status of http response.
/// </summary>
/// <value>
/// The HTTP status.
/// </value>
public HttpStatusCode HttpStatus
{
get; set;
}
#endregion Properties
}
}
================================================
FILE: ClientLibrary/FaceClientSDK.nuspec
================================================
<?xml version="1.0"?>
<package>
<metadata>
<id>Microsoft.ProjectOxford.Face</id>
<title>Microsoft Cognitive Services Face API Client Library</title>
<version>1.4.0</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<licenseUrl>https://github.com/Microsoft/Cognitive-Face-Windows/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://azure.microsoft.com/en-us/services/cognitive-services/face/</projectUrl>
<iconUrl>https://portalstoragewuprod.azureedge.net/media/Default/Media/FaceAPI/Icons_Vision_Face.svg</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Microsoft Cognitive Services Face API Client Library</description>
<summary>Use Face API Client Library to enrich your apps with Microsoft's state-of-the-art cloud-based face algorithms.</summary>
<releaseNotes>Million Scale support via LargePersonGroup/LargeFaceList.</releaseNotes>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>Face Oxford ProjectOxford Microsoft Cognitive CognitiveServices</tags>
<dependencies>
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="Microsoft.ProjectOxford.Common" version="1.0.324" />
</dependencies>
</metadata>
</package>
================================================
FILE: ClientLibrary/FaceServiceClient.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ProjectOxford.Face.Contract;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Microsoft.ProjectOxford.Face
{
using Face = Microsoft.ProjectOxford.Face.Contract.Face;
/// <summary>
/// The face service client proxy implementation.
/// </summary>
public class FaceServiceClient : IDisposable, IFaceServiceClient
{
#region Fields
/// <summary>
/// The default service host.
/// </summary>
private const string DEFAULT_API_ROOT = "https://westus.api.cognitive.microsoft.com/face/v1.0";
/// <summary>
/// The JSON content type header.
/// </summary>
private const string JsonContentTypeHeader = "application/json";
/// <summary>
/// The stream content type header.
/// </summary>
private const string StreamContentTypeHeader = "application/octet-stream";
/// <summary>
/// The subscription key name.
/// </summary>
private const string SubscriptionKeyName = "ocp-apim-subscription-key";
/// <summary>
/// The detect.
/// </summary>
private const string DetectQuery = "detect";
/// <summary>
/// The verify.
/// </summary>
private const string VerifyQuery = "verify";
/// <summary>
/// The train query.
/// </summary>
private const string TrainQuery = "train";
/// <summary>
/// The training query.
/// </summary>
private const string TrainingQuery = "training";
/// <summary>
/// The person groups.
/// </summary>
private const string PersonGroupsQuery = "persongroups";
/// <summary>
/// The person groups.
/// </summary>
private const string LargePersonGroupsQuery = "largepersongroups";
/// <summary>
/// The persons.
/// </summary>
private const string PersonsQuery = "persons";
/// <summary>
/// The persisted faces query string.
/// </summary>
private const string PersistedFacesQuery = "persistedfaces";
/// <summary>
/// The face list query
/// </summary>
private const string FaceListsQuery = "facelists";
/// <summary>
/// The face list query
/// </summary>
private const string LargeFaceListsQuery = "largefacelists";
/// <summary>
/// The endpoint for Find Similar API.
/// </summary>
private const string FindSimilarsQuery = "findsimilars";
/// <summary>
/// The identify.
/// </summary>
private const string IdentifyQuery = "identify";
/// <summary>
/// The group.
/// </summary>
private const string GroupQuery = "group";
/// <summary>
/// The settings
/// </summary>
private static JsonSerializerSettings s_settings = new JsonSerializerSettings()
{
DateFormatHandling = DateFormatHandling.IsoDateFormat,
NullValueHandling = NullValueHandling.Ignore,
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
/// <summary>
/// The subscription key.
/// </summary>
private readonly string _subscriptionKey;
/// <summary>
/// The root URI for the service endpoint.
/// </summary>
private readonly string _apiRoot;
/// <summary>
/// The HTTP client
/// </summary>
private HttpClient _httpClient;
#endregion Fields
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="FaceServiceClient"/> class.
/// </summary>
/// <param name="subscriptionKey">The subscription key.</param>
public FaceServiceClient(string subscriptionKey) : this(subscriptionKey, DEFAULT_API_ROOT) { }
/// <summary>
/// Initializes a new instance of the <see cref="FaceServiceClient"/> class.
/// </summary>
/// <param name="subscriptionKey">The subscription key.</param>
/// <param name="apiRoot">Root URI for the service endpoint.</param>
public FaceServiceClient(string subscriptionKey, string apiRoot)
{
this._subscriptionKey = subscriptionKey;
this._apiRoot = apiRoot?.TrimEnd('/');
this._httpClient = new HttpClient();
this._httpClient.DefaultRequestHeaders.Add(SubscriptionKeyName, this._subscriptionKey);
}
/// <summary>
/// Finalizes an instance of the <see cref="FaceServiceClient"/> class.
/// </summary>
~FaceServiceClient()
{
this.Dispose(false);
}
#endregion Constructors
#region Properties
/// <summary>
/// Gets service endpoint address, overridable by subclasses, default to free subscription's endpoint.
/// </summary>
protected virtual string ServiceHost => this._apiRoot;
/// <summary>
/// Gets default request headers for all following http request
/// </summary>
public HttpRequestHeaders DefaultRequestHeaders
{
get
{
return this._httpClient.DefaultRequestHeaders;
}
}
#endregion Properties
#region Face Methods
/// <summary>
/// Detects an URL asynchronously.
/// </summary>
/// <param name="imageUrl">The image URL.</param>
/// <param name="returnFaceId">If set to <c>true</c> [return face ID].</param>
/// <param name="returnFaceLandmarks">If set to <c>true</c> [return face landmarks].</param>
/// <param name="returnFaceAttributes">Face attributes need to be returned.</param>
/// <returns>The detected faces.</returns>
public async Task<Face[]> DetectAsync(string imageUrl, bool returnFaceId = true, bool returnFaceLandmarks = false, IEnumerable<FaceAttributeType> returnFaceAttributes = null)
{
if (returnFaceAttributes != null)
{
var requestUrl =
$"{this.ServiceHost}/{DetectQuery}?returnFaceId={returnFaceId}&returnFaceLandmarks={returnFaceLandmarks}&returnFaceAttributes={GetAttributeString(returnFaceAttributes)}";
return await this.SendRequestAsync<object, Face[]>(HttpMethod.Post, requestUrl, new { url = imageUrl });
}
else
{
var requestUrl =
$"{this.ServiceHost}/{DetectQuery}?returnFaceId={returnFaceId}&returnFaceLandmarks={returnFaceLandmarks}";
return await this.SendRequestAsync<object, Face[]>(HttpMethod.Post, requestUrl, new { url = imageUrl });
}
}
/// <summary>
/// Detects an image asynchronously.
/// </summary>
/// <param name="imageStream">The image stream.</param>
/// <param name="returnFaceId">If set to <c>true</c> [return face ID].</param>
/// <param name="returnFaceLandmarks">If set to <c>true</c> [return face landmarks].</param>
/// <param name="returnFaceAttributes">Face attributes need to be returned.</param>
/// <returns>The detected faces.</returns>
public async Task<Face[]> DetectAsync(Stream imageStream, bool returnFaceId = true, bool returnFaceLandmarks = false, IEnumerable<FaceAttributeType> returnFaceAttributes = null)
{
if (returnFaceAttributes != null)
{
var requestUrl =
$"{this.ServiceHost}/{DetectQuery}?returnFaceId={returnFaceId}&returnFaceLandmarks={returnFaceLandmarks}&returnFaceAttributes={GetAttributeString(returnFaceAttributes)}";
return await this.SendRequestAsync<Stream, Face[]>(HttpMethod.Post, requestUrl, imageStream);
}
else
{
var requestUrl =
$"{this.ServiceHost}/{DetectQuery}?returnFaceId={returnFaceId}&returnFaceLandmarks={returnFaceLandmarks}";
return await this.SendRequestAsync<Stream, Face[]>(HttpMethod.Post, requestUrl, imageStream);
}
}
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceIds">The face identifiers.</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar faces.
/// </returns>
public async Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] faceIds, int maxNumOfCandidatesReturned = 20)
{
return await this.FindSimilarAsync(faceId, faceIds, FindSimilarMatchMode.matchPerson, maxNumOfCandidatesReturned);
}
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceIds">The face identifiers.</param>
/// <param name="mode">Algorithm mode option, default as "matchPerson".</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar faces.
/// </returns>
public async Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] faceIds, FindSimilarMatchMode mode, int maxNumOfCandidatesReturned = 20)
{
var requestUrl = $"{this.ServiceHost}/{FindSimilarsQuery}";
return await this.SendRequestAsync<object, SimilarFace[]>(
HttpMethod.Post,
requestUrl,
new
{
faceId = faceId,
faceIds = faceIds,
maxNumOfCandidatesReturned = maxNumOfCandidatesReturned,
mode = mode.ToString()
});
}
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar persisted faces.
/// </returns>
public async Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId, string faceListId, int maxNumOfCandidatesReturned = 20)
{
return await this.FindSimilarAsync(faceId, faceListId, FindSimilarMatchMode.matchPerson, maxNumOfCandidatesReturned);
}
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="mode">Algorithm mode option, default as "matchPerson".</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar persisted faces.
/// </returns>
public async Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId, string faceListId, FindSimilarMatchMode mode, int maxNumOfCandidatesReturned = 20)
{
return await this.FindSimilarAsync(faceId, faceListId, null, mode, maxNumOfCandidatesReturned);
}
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="mode">Algorithm mode option, default as "matchPerson".</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar persisted faces.
/// </returns>
public async Task<SimilarPersistedFace[]> FindSimilarAsync(
Guid faceId,
string faceListId = null,
string largeFaceListId = null,
FindSimilarMatchMode mode = FindSimilarMatchMode.matchPerson,
int maxNumOfCandidatesReturned = 20)
{
var requestUrl = $"{this.ServiceHost}/{FindSimilarsQuery}";
return await this.SendRequestAsync<object, SimilarPersistedFace[]>(
HttpMethod.Post,
requestUrl,
new
{
faceId = faceId,
faceListId = faceListId,
largeFaceListId = largeFaceListId,
maxNumOfCandidatesReturned = maxNumOfCandidatesReturned,
mode = mode.ToString()
});
}
/// <summary>
/// Groups the face asynchronously.
/// </summary>
/// <param name="faceIds">The face ids.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task<GroupResult> GroupAsync(Guid[] faceIds)
{
var requestUrl = $"{this.ServiceHost}/{GroupQuery}";
return await this.SendRequestAsync<object, GroupResult>(
HttpMethod.Post,
requestUrl,
new
{
faceIds = faceIds
});
}
/// <summary>
/// Identities the faces in a given person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="faceIds">The face ids.</param>
/// <param name="maxNumOfCandidatesReturned">The maximum number of candidates returned for each face.</param>
/// <returns>The identification results</returns>
public async Task<IdentifyResult[]> IdentifyAsync(string personGroupId, Guid[] faceIds, int maxNumOfCandidatesReturned = 1)
{
return await this.IdentifyAsync(personGroupId, faceIds, 0.5f, maxNumOfCandidatesReturned);
}
/// <summary>
/// Identities the faces in a given person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="faceIds">The face ids.</param>
/// <param name="confidenceThreshold">user-specified confidence threshold.</param>
/// <param name="maxNumOfCandidatesReturned">The maximum number of candidates returned for each face.</param>
/// <returns>The identification results</returns>
public async Task<IdentifyResult[]> IdentifyAsync(string personGroupId, Guid[] faceIds, float confidenceThreshold, int maxNumOfCandidatesReturned = 1)
{
return await this.IdentifyAsync(faceIds, personGroupId, null, confidenceThreshold, maxNumOfCandidatesReturned);
}
/// <summary>
/// Identities the faces in a given person group or large person group asynchronously.
/// </summary>
/// <param name="faceIds">The face ids.</param>
/// <param name="personGroupId">The person group id.</param>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="confidenceThreshold">user-specified confidence threshold.</param>
/// <param name="maxNumOfCandidatesReturned">The maximum number of candidates returned for each face.</param>
/// <returns>The identification results</returns>
public async Task<IdentifyResult[]> IdentifyAsync(
Guid[] faceIds,
string personGroupId = null,
string largePersonGroupId = null,
float confidenceThreshold = 0.5f,
int maxNumOfCandidatesReturned = 1)
{
var requestUrl = $"{this.ServiceHost}/{IdentifyQuery}";
return await this.SendRequestAsync<object, IdentifyResult[]>(
HttpMethod.Post,
requestUrl,
new
{
faceIds = faceIds,
personGroupId = personGroupId,
largePersonGroupId = largePersonGroupId,
confidenceThreshold = confidenceThreshold,
maxNumOfCandidatesReturned = maxNumOfCandidatesReturned
});
}
/// <summary>
/// Verifies whether the specified two faces belong to the same person asynchronously.
/// </summary>
/// <param name="faceId1">The face id 1.</param>
/// <param name="faceId2">The face id 2.</param>
/// <returns>The verification result.</returns>
public async Task<VerifyResult> VerifyAsync(Guid faceId1, Guid faceId2)
{
var requestUrl = $"{this.ServiceHost}/{VerifyQuery}";
return await this.SendRequestAsync<object, VerifyResult>(
HttpMethod.Post,
requestUrl,
new
{
faceId1 = faceId1,
faceId2 = faceId2
});
}
/// <summary>
/// Verifies whether the specified face belong to the specified person asynchronously.
/// </summary>
/// <param name="faceId">the face ID</param>
/// <param name="personGroupId">the person group ID</param>
/// <param name="personId">the person ID</param>
/// <returns>The verification result.</returns>
public async Task<VerifyResult> VerifyAsync(Guid faceId, string personGroupId, Guid personId)
{
return await this.VerifyAsync(faceId, personId, personGroupId);
}
/// <summary>
/// Verify whether one face belong to a person.
/// </summary>
/// <param name="faceId">The face id.</param>
/// <param name="personId">The person id.</param>
/// <param name="personGroupId">The person group id.</param>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <returns>Verification result.</returns>
public async Task<VerifyResult> VerifyAsync(
Guid faceId,
Guid personId,
string personGroupId = null,
string largePersonGroupId = null)
{
var requestUrl = $"{this.ServiceHost}/{VerifyQuery}";
return await this.SendRequestAsync<object, VerifyResult>(
HttpMethod.Post,
requestUrl,
new
{
faceId = faceId,
personGroupId = personGroupId,
largePersonGroupId = largePersonGroupId,
personId = personId
});
}
#endregion
#region FaceList Methods
/// <summary>
/// Creates the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task CreateFaceListAsync(string faceListId, string name, string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{FaceListsQuery}/{faceListId}";
await this.SendRequestAsync<object, object>(
HttpMethod.Put,
requestUrl,
new
{
name = name,
userData = userData
});
}
/// <summary>
/// Deletes the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task DeleteFaceListAsync(string faceListId)
{
var requestUrl = $"{this.ServiceHost}/{FaceListsQuery}/{faceListId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <returns>
/// Face list object.
/// </returns>
public async Task<FaceList> GetFaceListAsync(string faceListId)
{
var requestUrl = $"{this.ServiceHost}/{FaceListsQuery}/{faceListId}";
return await this.SendRequestAsync<object, FaceList>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// List the face lists asynchronously.
/// </summary>
/// <returns>
/// FaceListMetadata array.
/// </returns>
public async Task<FaceListMetadata[]> ListFaceListsAsync()
{
var requestUrl = $"{this.ServiceHost}/{FaceListsQuery}";
return await this.SendRequestAsync<object, FaceListMetadata[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Updates the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task UpdateFaceListAsync(string faceListId, string name, string userData)
{
var requestUrl = $"{this.ServiceHost}/{FaceListsQuery}/{faceListId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new
{
name = name,
userData = userData
});
}
#endregion
#region FaceList Face Methods
/// <summary>
/// Adds the face to face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="imageUrl">The face image URL.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddFaceToFaceListAsync(
string faceListId,
string imageUrl,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{FaceListsQuery}/{faceListId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<object, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
new { url = imageUrl });
}
/// <summary>
/// Adds the face to face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="imageStream">The face image stream.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddFaceToFaceListAsync(
string faceListId,
Stream imageStream,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{FaceListsQuery}/{faceListId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<object, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
imageStream);
}
/// <summary>
/// Deletes the face from face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>Task object.</returns>
public async Task DeleteFaceFromFaceListAsync(string faceListId, Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{FaceListsQuery}/{faceListId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
#endregion
#region PersonGroup Methods
/// <summary>
/// Creates the person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
public async Task CreatePersonGroupAsync(string personGroupId, string name, string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}";
await this.SendRequestAsync<object, object>(
HttpMethod.Put,
requestUrl,
new
{
name = name,
userData = userData
});
}
/// <summary>
/// Deletes a person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <returns>Task object.</returns>
public async Task DeletePersonGroupAsync(string personGroupId)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets a person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <returns>The person group entity.</returns>
public async Task<PersonGroup> GetPersonGroupAsync(string personGroupId)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}";
return await this.SendRequestAsync<object, PersonGroup>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Gets person group training status asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <returns>The person group training status.</returns>
public async Task<TrainingStatus> GetPersonGroupTrainingStatusAsync(string personGroupId)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{TrainingQuery}";
return await this.SendRequestAsync<object, TrainingStatus>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Gets person groups asynchronously.
/// </summary>
/// <returns>Person group entity array.</returns>
[Obsolete("use ListPersonGroupsAsync instead")]
public async Task<PersonGroup[]> GetPersonGroupsAsync()
{
return await this.ListPersonGroupsAsync();
}
/// <summary>
/// Asynchronously list the top person groups whose Id is larger than "start".
/// </summary>
/// <param name="start">person group Id bar. List the person groups whose Id is larger than "start".</param>
/// <param name="top">the number of person groups to list.</param>
/// <returns>Person group entity array.</returns>
public async Task<PersonGroup[]> ListPersonGroupsAsync(string start = "", int top = 1000)
{
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}?start={start}&top={top.ToString(CultureInfo.InvariantCulture)}";
return await this.SendRequestAsync<object, PersonGroup[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Trains the person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <returns>Task object.</returns>
public async Task TrainPersonGroupAsync(string personGroupId)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{TrainQuery}";
await this.SendRequestAsync<object, object>(HttpMethod.Post, requestUrl, null);
}
/// <summary>
/// Updates a person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
public async Task UpdatePersonGroupAsync(string personGroupId, string name, string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new
{
name = name,
userData = userData
});
}
#endregion
#region PersonGroup Person Methods
/// <summary>
/// Creates a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>The CreatePersonResult entity.</returns>
public async Task<CreatePersonResult> CreatePersonAsync(
string personGroupId,
string name,
string userData = null)
{
return await this.CreatePersonInPersonGroupAsync(personGroupId, name, userData);
}
/// <summary>
/// Creates a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>The CreatePersonResult entity.</returns>
public async Task<CreatePersonResult> CreatePersonInPersonGroupAsync(
string personGroupId,
string name,
string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}";
return await this.SendRequestAsync<object, CreatePersonResult>(
HttpMethod.Post,
requestUrl,
new { name = name, userData = userData });
}
/// <summary>
/// Deletes a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>Task object.</returns>
public async Task DeletePersonAsync(string personGroupId, Guid personId)
{
await this.DeletePersonFromPersonGroupAsync(personGroupId, personId);
}
/// <summary>
/// Deletes a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>Task object.</returns>
public async Task DeletePersonFromPersonGroupAsync(string personGroupId, Guid personId)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>The person entity.</returns>
public async Task<Person> GetPersonAsync(string personGroupId, Guid personId)
{
return await this.GetPersonInPersonGroupAsync(personGroupId, personId);
}
/// <summary>
/// Gets a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>The person entity.</returns>
public async Task<Person> GetPersonInPersonGroupAsync(string personGroupId, Guid personId)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}";
return await this.SendRequestAsync<object, Person>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Gets persons inside a person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <returns>
/// The person entity array.
/// </returns>
[Obsolete("use ListPersonsAsync instead")]
public async Task<Person[]> GetPersonsAsync(string personGroupId)
{
return await this.ListPersonsAsync(personGroupId);
}
/// <summary>
/// List the top persons whose Id is larger than "start" inside a person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="start">Person Id bar. List the persons whose Id is larger than "start".</param>
/// <param name="top">The number of persons to list.</param>>
/// <returns>
/// The person entity array.
/// </returns>
public async Task<Person[]> ListPersonsAsync(string personGroupId, string start = "", int top = 1000)
{
return await this.ListPersonsInPersonGroupAsync(personGroupId, start, top);
}
/// <summary>
/// List the top persons whose Id is larger than "start" inside a person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="start">Person Id bar. List the persons whose Id is larger than "start".</param>
/// <param name="top">The number of persons to list.</param>>
/// <returns>
/// The person entity array.
/// </returns>
public async Task<Person[]> ListPersonsInPersonGroupAsync(
string personGroupId,
string start = "",
int top = 1000)
{
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}?start={start}&top={top.ToString(CultureInfo.InvariantCulture)}";
return await this.SendRequestAsync<object, Person[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Updates a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
public async Task UpdatePersonAsync(string personGroupId, Guid personId, string name, string userData = null)
{
await this.UpdatePersonInPersonGroupAsync(personGroupId, personId, name, userData);
}
/// <summary>
/// Updates a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
public async Task UpdatePersonInPersonGroupAsync(
string personGroupId,
Guid personId,
string name,
string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { name = name, userData = userData });
}
#endregion
#region PersonGroup PersonFace Methods
/// <summary>
/// Adds a face to a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="imageUrl">The face image URL.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add person face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddPersonFaceAsync(
string personGroupId,
Guid personId,
string imageUrl,
string userData = null,
FaceRectangle targetFace = null)
{
return await this.AddPersonFaceInPersonGroupAsync(personGroupId, personId, imageUrl, userData, targetFace);
}
/// <summary>
/// Adds a face to a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="imageUrl">The face image URL.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add person face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddPersonFaceInPersonGroupAsync(
string personGroupId,
Guid personId,
string imageUrl,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<object, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
new { url = imageUrl });
}
/// <summary>
/// Adds a face to a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="imageStream">The face image stream.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add person face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddPersonFaceAsync(
string personGroupId,
Guid personId,
Stream imageStream,
string userData = null,
FaceRectangle targetFace = null)
{
return await this.AddPersonFaceInPersonGroupAsync(
personGroupId,
personId,
imageStream,
userData,
targetFace);
}
/// <summary>
/// Adds a face to a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="imageStream">The face image stream.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add person face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddPersonFaceInPersonGroupAsync(
string personGroupId,
Guid personId,
Stream imageStream,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<Stream, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
imageStream);
}
/// <summary>
/// Deletes a face of a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task DeletePersonFaceAsync(string personGroupId, Guid personId, Guid persistedFaceId)
{
await this.DeletePersonFaceFromPersonGroupAsync(personGroupId, personId, persistedFaceId);
}
/// <summary>
/// Deletes a face of a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task DeletePersonFaceFromPersonGroupAsync(
string personGroupId,
Guid personId,
Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets a face of a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>
/// The person face entity.
/// </returns>
public async Task<PersistedFace> GetPersonFaceAsync(string personGroupId, Guid personId, Guid persistedFaceId)
{
return await this.GetPersonFaceInPersonGroupAsync(personGroupId, personId, persistedFaceId);
}
/// <summary>
/// Gets a face of a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>
/// The person face entity.
/// </returns>
public async Task<PersistedFace> GetPersonFaceInPersonGroupAsync(string personGroupId, Guid personId, Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}/{persistedFaceId}";
return await this.SendRequestAsync<object, PersistedFace>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Updates a face of a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <param name="userData">The user data.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task UpdatePersonFaceAsync(
string personGroupId,
Guid personId,
Guid persistedFaceId,
string userData)
{
await this.UpdatePersonFaceInPersonGroupAsync(personGroupId, personId, persistedFaceId, userData);
}
/// <summary>
/// Updates a face of a person asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <param name="userData">The user data.</param>
/// <returns>
/// Task object.
/// </returns>
public async Task UpdatePersonFaceInPersonGroupAsync(
string personGroupId,
Guid personId,
Guid persistedFaceId,
string userData)
{
var requestUrl =
$"{this.ServiceHost}/{PersonGroupsQuery}/{personGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { userData = userData });
}
#endregion
#region LargeFaceList Methods
/// <summary>
/// Creates the large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
public async Task CreateLargeFaceListAsync(string largeFaceListId, string name, string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}";
await this.SendRequestAsync<object, object>(
HttpMethod.Put,
requestUrl,
new { name = name, userData = userData });
}
/// <summary>
/// Deletes the large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <returns>public async Task object.</returns>
public async Task DeleteLargeFaceListAsync(string largeFaceListId)
{
var requestUrl = $"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets the large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <returns>Face list object.</returns>
public async Task<LargeFaceList> GetLargeFaceListAsync(string largeFaceListId)
{
var requestUrl = $"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}";
return await this.SendRequestAsync<object, LargeFaceList>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Gets large face list training status asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list id.</param>
/// <returns>The large face list training status.</returns>
public async Task<TrainingStatus> GetLargeFaceListTrainingStatusAsync(string largeFaceListId)
{
var requestUrl = $"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{TrainingQuery}";
return await this.SendRequestAsync<object, TrainingStatus>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Lists the large face lists asynchronously.
/// </summary>
/// <param name="start">The start point string in listing large face lists</param>
/// <param name="top">The number of large face lists to list</param>
/// <returns>LargeFaceListMetadata array.</returns>
public async Task<LargeFaceList[]> ListLargeFaceListsAsync(string start = "", int top = 1000)
{
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}?start={start}&top={top.ToString(CultureInfo.InvariantCulture)}";
return await this.SendRequestAsync<object, LargeFaceList[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Trains the large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list id.</param>
/// <returns>public async Task object.</returns>
public async Task TrainLargeFaceListAsync(string largeFaceListId)
{
var requestUrl = $"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{TrainQuery}";
await this.SendRequestAsync<object, object>(HttpMethod.Post, requestUrl, null);
}
/// <summary>
/// Updates the large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>public async Task object.</returns>
public async Task UpdateLargeFaceListAsync(string largeFaceListId, string name, string userData)
{
var requestUrl = $"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { name = name, userData = userData });
}
#endregion
#region LargeFaceList Face Methods
/// <summary>
/// Adds the face to large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="imageUrl">The face image URL.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddFaceToLargeFaceListAsync(
string largeFaceListId,
string imageUrl,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<object, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
new { url = imageUrl });
}
/// <summary>
/// Adds the face to large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="imageStream">The face image stream.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddFaceToLargeFaceListAsync(
string largeFaceListId,
Stream imageStream,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<object, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
imageStream);
}
/// <summary>
/// Deletes the face from large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="persistedFaceId">The persisted face identifier.</param>
/// <returns>public async Task object.</returns>
public async Task DeleteFaceFromLargeFaceListAsync(string largeFaceListId, Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets the face in large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="persistedFaceId">The persisted face identifier.</param>
/// <returns>Persisted Face object.</returns>
public async Task<PersistedFace> GetFaceInLargeFaceListAsync(string largeFaceListId, Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{PersistedFacesQuery}/{persistedFaceId}";
return await this.SendRequestAsync<object, PersistedFace>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Lists the faces in large face lists asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="start">The start point string to list faces in large face lists.</param>
/// <param name="top">The number of faces to list.</param>
/// <returns>PersistedFace array.</returns>
public async Task<PersistedFace[]> ListFacesInLargeFaceListAsync(
string largeFaceListId,
string start = "",
int top = 1000)
{
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{PersistedFacesQuery}?start={start}&top={top.ToString(CultureInfo.InvariantCulture)}";
return await this.SendRequestAsync<object, PersistedFace[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Updates the face in large face list asynchronously.
/// </summary>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="persistedFaceId">The persisted face identifier.</param>
/// <param name="userData">The user data.</param>
/// <returns>public async Task object.</returns>
public async Task UpdateFaceInLargeFaceListAsync(string largeFaceListId, Guid persistedFaceId, string userData)
{
var requestUrl =
$"{this.ServiceHost}/{LargeFaceListsQuery}/{largeFaceListId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { userData = userData });
}
#endregion
#region LargePersonGroup Methods
/// <summary>
/// Creates the large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>public async Task object.</returns>
public async Task CreateLargePersonGroupAsync(string largePersonGroupId, string name, string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}";
await this.SendRequestAsync<object, object>(
HttpMethod.Put,
requestUrl,
new { name = name, userData = userData });
}
/// <summary>
/// Deletes a large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <returns>public async Task object.</returns>
public async Task DeleteLargePersonGroupAsync(string largePersonGroupId)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets a large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <returns>The large person group entity.</returns>
public async Task<LargePersonGroup> GetLargePersonGroupAsync(string largePersonGroupId)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}";
return await this.SendRequestAsync<object, LargePersonGroup>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Gets large person group training status asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <returns>The large person group training status.</returns>
public async Task<TrainingStatus> GetLargePersonGroupTrainingStatusAsync(string largePersonGroupId)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{TrainingQuery}";
return await this.SendRequestAsync<object, TrainingStatus>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Asynchronously list the top large person groups whose Id is larger than "start".
/// </summary>
/// <param name="start">the start point string in listing large person groups</param>
/// <param name="top">the number of large person groups to list</param>
/// <returns>The large person group entity array.</returns>
public async Task<LargePersonGroup[]> ListLargePersonGroupsAsync(string start = "", int top = 1000)
{
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}?start={start}&top={top.ToString(CultureInfo.InvariantCulture)}";
return await this.SendRequestAsync<object, LargePersonGroup[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Trains the large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <returns>public async Task object.</returns>
public async Task TrainLargePersonGroupAsync(string largePersonGroupId)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{TrainQuery}";
await this.SendRequestAsync<object, object>(HttpMethod.Post, requestUrl, null);
}
/// <summary>
/// Updates a large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>public async Task object.</returns>
public async Task UpdateLargePersonGroupAsync(string largePersonGroupId, string name, string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { name = name, userData = userData });
}
#endregion
#region LargePersonGroup Person Methods
/// <summary>
/// Creates a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>The CreatePersonResult entity.</returns>
public async Task<CreatePersonResult> CreatePersonInLargePersonGroupAsync(
string largePersonGroupId,
string name,
string userData = null)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}";
return await this.SendRequestAsync<object, CreatePersonResult>(
HttpMethod.Post,
requestUrl,
new { name = name, userData = userData });
}
/// <summary>
/// Deletes a person from large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>public async Task object.</returns>
public async Task DeletePersonFromLargePersonGroupAsync(string largePersonGroupId, Guid personId)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>The person entity.</returns>
public async Task<Person> GetPersonInLargePersonGroupAsync(string largePersonGroupId, Guid personId)
{
var requestUrl = $"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}";
return await this.SendRequestAsync<object, Person>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Asynchronously list the top persons in large person group whose Id is larger than "start".
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="start">The start point string in listing persons</param>
/// <param name="top">The number of persons to list</param>
/// <returns>Person entity array.</returns>
public async Task<Person[]> ListPersonsInLargePersonGroupAsync(
string largePersonGroupId,
string start = "",
int top = 1000)
{
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}?start={start}&top={top.ToString(CultureInfo.InvariantCulture)}";
return await this.SendRequestAsync<object, Person[]>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Updates a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>public async Task object.</returns>
public async Task UpdatePersonInLargePersonGroupAsync(
string largePersonGroupId,
Guid personId,
string name,
string userData = null)
{
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { name = name, userData = userData });
}
#endregion
#region LargePersonGroup PersonFace Methods
/// <summary>
/// Adds a face to a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="imageUrl">The face image URL.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The target face.</param>
/// <returns>
/// Add person face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddPersonFaceInLargePersonGroupAsync(
string largePersonGroupId,
Guid personId,
string imageUrl,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<object, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
new { url = imageUrl });
}
/// <summary>
/// Adds a face to a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="imageStream">The face image stream.</param>
/// <param name="userData">The user data.</param>
/// <param name="targetFace">The Target Face.</param>
/// <returns>
/// Add person face result.
/// </returns>
public async Task<AddPersistedFaceResult> AddPersonFaceInLargePersonGroupAsync(
string largePersonGroupId,
Guid personId,
Stream imageStream,
string userData = null,
FaceRectangle targetFace = null)
{
var targetFaceString = targetFace == null
? string.Empty
: $"{targetFace.Left},{targetFace.Top},{targetFace.Width},{targetFace.Height}";
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}?userData={userData}&targetFace={targetFaceString}";
return await this.SendRequestAsync<Stream, AddPersistedFaceResult>(
HttpMethod.Post,
requestUrl,
imageStream);
}
/// <summary>
/// Deletes a face of a person from large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>public async Task object.</returns>
public async Task DeletePersonFaceFromLargePersonGroupAsync(
string largePersonGroupId,
Guid personId,
Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(HttpMethod.Delete, requestUrl, null);
}
/// <summary>
/// Gets a face of a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <returns>The person face entity.</returns>
public async Task<PersistedFace> GetPersonFaceInLargePersonGroupAsync(
string largePersonGroupId,
Guid personId,
Guid persistedFaceId)
{
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}/{persistedFaceId}";
return await this.SendRequestAsync<object, PersistedFace>(HttpMethod.Get, requestUrl, null);
}
/// <summary>
/// Updates a face of a person in large person group asynchronously.
/// </summary>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="personId">The person id.</param>
/// <param name="persistedFaceId">The persisted face id.</param>
/// <param name="userData">The user data.</param>
/// <returns>public async Task object.</returns>
public async Task UpdatePersonFaceInLargePersonGroupAsync(
string largePersonGroupId,
Guid personId,
Guid persistedFaceId,
string userData = null)
{
var requestUrl =
$"{this.ServiceHost}/{LargePersonGroupsQuery}/{largePersonGroupId}/{PersonsQuery}/{personId}/{PersistedFacesQuery}/{persistedFaceId}";
await this.SendRequestAsync<object, object>(
new HttpMethod("PATCH"),
requestUrl,
new { userData = userData });
}
#endregion
#region Methods
/// <summary>
/// Gets face attribute query string from attribute types
/// </summary>
/// <param name="types">Face attribute types</param>
/// <returns>Face attribute query string</returns>
public static string GetAttributeString(IEnumerable<FaceAttributeType> types)
{
return string.Join(",", types.Select(attr =>
{
var attrStr = attr.ToString();
return char.ToLowerInvariant(attrStr[0]) + attrStr.Substring(1);
}).ToArray());
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (this._httpClient != null)
{
this._httpClient.Dispose();
this._httpClient = null;
}
}
}
/// <summary>
/// Sends the request asynchronous.
/// </summary>
/// <typeparam name="TRequest">The type of the request.</typeparam>
/// <typeparam name="TResponse">The type of the response.</typeparam>
/// <param name="httpMethod">The HTTP method.</param>
/// <param name="requestUrl">The request URL.</param>
/// <param name="requestBody">The request body.</param>
/// <returns>The response.</returns>
/// <exception cref="OxfordAPIException">The client exception.</exception>
private async Task<TResponse> SendRequestAsync<TRequest, TResponse>(HttpMethod httpMethod, string requestUrl, TRequest requestBody)
{
var request = new HttpRequestMessage(httpMethod, this.ServiceHost);
request.RequestUri = new Uri(requestUrl);
if (requestBody != null)
{
if (requestBody is Stream)
{
request.Content = new StreamContent(requestBody as Stream);
request.Content.Headers.ContentType = new MediaTypeHeaderValue(StreamContentTypeHeader);
}
else
{
request.Content = new StringContent(JsonConvert.SerializeObject(requestBody, s_settings), Encoding.UTF8, JsonContentTypeHeader);
}
}
HttpResponseMessage response = await this._httpClient.SendAsync(request);
if (response.IsSuccessStatusCode)
{
string responseContent = null;
if (response.Content != null)
{
responseContent = await response.Content.ReadAsStringAsync();
}
if (!string.IsNullOrWhiteSpace(responseContent))
{
return JsonConvert.DeserializeObject<TResponse>(responseContent, s_settings);
}
return default(TResponse);
}
else
{
if (response.Content != null && response.Content.Headers.ContentType.MediaType.Contains(JsonContentTypeHeader))
{
var errorObjectString = await response.Content.ReadAsStringAsync();
ClientError clientEx = JsonConvert.DeserializeObject<ClientError>(errorObjectString);
if (clientEx.Error != null)
{
throw new FaceAPIException(clientEx.Error.ErrorCode, clientEx.Error.Message, response.StatusCode);
}
else
{
ServiceError serviceEx = JsonConvert.DeserializeObject<ServiceError>(errorObjectString);
if (serviceEx.ErrorCode != null)
{
throw new FaceAPIException(serviceEx.ErrorCode, serviceEx.Message, response.StatusCode);
}
else
{
throw new FaceAPIException("Unknown", "Unknown Error", response.StatusCode);
}
}
}
response.EnsureSuccessStatusCode();
}
return default(TResponse);
}
#endregion Methods
}
}
================================================
FILE: ClientLibrary/IFaceServiceClient.cs
================================================
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-Windows
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.ProjectOxford.Face.Contract;
namespace Microsoft.ProjectOxford.Face
{
using Face = Microsoft.ProjectOxford.Face.Contract.Face;
#region Enumerations
/// <summary>
/// Supported face attribute types
/// </summary>
public enum FaceAttributeType
{
/// <summary>
/// Analyses age
/// </summary>
Age,
/// <summary>
/// Analyses gender
/// </summary>
Gender,
/// <summary>
/// Analyses head pose
/// </summary>
HeadPose,
/// <summary>
/// Analyses whether is smiling
/// </summary>
Smile,
/// <summary>
/// Analyses facial hair
/// </summary>
FacialHair,
/// <summary>
/// Analyses glasses type
/// </summary>
Glasses,
/// <summary>
/// Analyses emotion
/// </summary>
Emotion,
/// <summary>
/// Analyses hair
/// </summary>
Hair,
/// <summary>
/// Analyses makeup
/// </summary>
Makeup,
/// <summary>
/// Analyses occlusion
/// </summary>
Occlusion,
/// <summary>
/// Analyses accessory
/// </summary>
Accessories,
/// <summary>
/// Analyses blur
/// </summary>
Blur,
/// <summary>
/// Analyses exposure
/// </summary>
Exposure,
/// <summary>
/// Analyses noise
/// </summary>
Noise
}
/// <summary>
/// two working modes of Face - Find Similar
/// </summary>
public enum FindSimilarMatchMode
{
/// <summary>
/// matchPerson mode of Face - Find Similar, return the similar faces of the same person with the query face.
/// </summary>
matchPerson,
/// <summary>
/// matchFace mode of Face - Find Similar, return the similar faces of the query face, ignoring if they belong to the same person.
/// </summary>
matchFace
}
#endregion Enumerations
/// <summary>
/// The face service client proxy interface.
/// </summary>
public interface IFaceServiceClient
{
#region Properties
/// <summary>
/// Gets default request headers for all following http request
/// </summary>
HttpRequestHeaders DefaultRequestHeaders
{
get;
}
#endregion Properties
#region Face Methods
/// <summary>
/// Detects an URL asynchronously.
/// </summary>
/// <param name="imageUrl">The image URL.</param>
/// <param name="returnFaceId">If set to <c>true</c> [return face ID].</param>
/// <param name="returnFaceLandmarks">If set to <c>true</c> [return face landmarks].</param>
/// <param name="returnFaceAttributes">Return face attributes.</param>
/// <returns>The detected faces.</returns>
Task<Face[]> DetectAsync(string imageUrl, bool returnFaceId = true, bool returnFaceLandmarks = false, IEnumerable<FaceAttributeType> returnFaceAttributes = null);
/// <summary>
/// Detects an image asynchronously.
/// </summary>
/// <param name="imageStream">The image stream.</param>
/// <param name="returnFaceId">If set to <c>true</c> [return face ID].</param>
/// <param name="returnFaceLandmarks">If set to <c>true</c> [return face landmarks].</param>
/// <param name="returnFaceAttributes">Return face attributes.</param>
/// <returns>The detected faces.</returns>
Task<Face[]> DetectAsync(Stream imageStream, bool returnFaceId = true, bool returnFaceLandmarks = false, IEnumerable<FaceAttributeType> returnFaceAttributes = null);
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceIds">The face identifiers.</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar faces.
/// </returns>
Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] faceIds, int maxNumOfCandidatesReturned = 20);
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceIds">The face identifiers.</param>
/// <param name="mode">Algorithm mode option, default as "matchPerson".</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar faces.
/// </returns>
Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] faceIds, FindSimilarMatchMode mode, int maxNumOfCandidatesReturned = 20);
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar persisted faces.
/// </returns>
[Obsolete("use the FindSimilarAsync support both Face List and Large Face List instead")]
Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId, string faceListId, int maxNumOfCandidatesReturned = 20);
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="mode">Algorithm mode option, default as "matchPerson".</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar persisted faces.
/// </returns>
[Obsolete("use the FindSimilarAsync support both Face List and Large Face List instead")]
Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId, string faceListId, FindSimilarMatchMode mode, int maxNumOfCandidatesReturned = 20);
/// <summary>
/// Finds the similar faces asynchronously.
/// </summary>
/// <param name="faceId">The face identifier.</param>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="largeFaceListId">The large face list identifier.</param>
/// <param name="mode">Algorithm mode option, default as "matchPerson".</param>
/// <param name="maxNumOfCandidatesReturned">The max number of candidates returned.</param>
/// <returns>
/// The similar persisted faces.
/// </returns>
Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId, string faceListId = null, string largeFaceListId = null, FindSimilarMatchMode mode = FindSimilarMatchMode.matchPerson, int maxNumOfCandidatesReturned = 20);
/// <summary>
/// Groups the face asynchronously.
/// </summary>
/// <param name="faceIds">The face ids.</param>
/// <returns>Task object.</returns>
Task<GroupResult> GroupAsync(Guid[] faceIds);
/// <summary>
/// Identities the faces in a given person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="faceIds">The face ids.</param>
/// <param name="maxNumOfCandidatesReturned">The maximum number of candidates returned for each face.</param>
/// <returns>The identification results</returns>
[Obsolete("use the IdentifyAsync support both Person Group and Large Person Group instead")]
Task<IdentifyResult[]> IdentifyAsync(string personGroupId, Guid[] faceIds, int maxNumOfCandidatesReturned = 1);
/// <summary>
/// Identities the faces in a given person group asynchronously.
/// </summary>
/// <param name="personGroupId">The person group id.</param>
/// <param name="faceIds">The face ids.</param>
/// <param name="confidenceThreshold">user-specified confidence threshold.</param>
/// <param name="maxNumOfCandidatesReturned">The maximum number of candidates returned for each face.</param>
/// <returns>The identification results</returns>
[Obsolete("use the IdentifyAsync support both Person Group and Large Person Group instead")]
Task<IdentifyResult[]> IdentifyAsync(string personGroupId, Guid[] faceIds, float confidenceThreshold, int maxNumOfCandidatesReturned = 1);
/// <summary>
/// Identities the faces in a given person group or large person group asynchronously.
/// </summary>
/// <param name="faceIds">The face ids.</param>
/// <param name="personGroupId">The person group id.</param>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <param name="confidenceThreshold">user-specified confidence threshold.</param>
/// <param name="maxNumOfCandidatesReturned">The maximum number of candidates returned for each face.</param>
/// <returns>The identification results</returns>
Task<IdentifyResult[]> IdentifyAsync(Guid[] faceIds, string personGroupId = null, string largePersonGroupId = null, float confidenceThreshold = 0.5f, int maxNumOfCandidatesReturned = 1);
/// <summary>
/// Verifies whether the specified two faces belong to the same person asynchronously.
/// </summary>
/// <param name="faceId1">The face id 1.</param>
/// <param name="faceId2">The face id 2.</param>
/// <returns>The verification result.</returns>
Task<VerifyResult> VerifyAsync(Guid faceId1, Guid faceId2);
/// <summary>
/// Verify whether one face belong to a person.
/// </summary>
/// <param name="faceId">The face id.</param>
/// <param name="personGroupId">The person group id.</param>
/// <param name="personId">The person id.</param>
/// <returns>Verification result.</returns>
[Obsolete("use the VerifyAsync supports both Person Group and Large Person Group instead")]
Task<VerifyResult> VerifyAsync(Guid faceId, string personGroupId, Guid personId);
/// <summary>
/// Verify whether one face belong to a person.
/// </summary>
/// <param name="faceId">The face id.</param>
/// <param name="personId">The person id.</param>
/// <param name="personGroupId">The person group id.</param>
/// <param name="largePersonGroupId">The large person group id.</param>
/// <returns>Verification result.</returns>
Task<VerifyResult> VerifyAsync(Guid faceId, Guid personId, string personGroupId = null, string largePersonGroupId = null);
#endregion
#region FaceList Methods
/// <summary>
/// Creates the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
Task CreateFaceListAsync(string faceListId, string name, string userData = null);
/// <summary>
/// Deletes the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <returns>Task object.</returns>
Task DeleteFaceListAsync(string faceListId);
/// <summary>
/// Gets the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <returns>Face list object.</returns>
Task<FaceList> GetFaceListAsync(string faceListId);
/// <summary>
/// Lists the face lists asynchronously.
/// </summary>
/// <returns>FaceListMetadata array.</returns>
Task<FaceListMetadata[]> ListFaceListsAsync();
/// <summary>
/// Updates the face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="name">The name.</param>
/// <param name="userData">The user data.</param>
/// <returns>Task object.</returns>
Task UpdateFaceListAsync(string faceListId, string name, string userData);
#endregion
#region FaceList Face Methods
/// <summary>
/// Adds the face to face list asynchronously.
/// </summary>
/// <param name="faceListId">The face list identifier.</param>
/// <param name="imageUrl">The face image URL.</param>
/// <param name
gitextract_vv6euq7q/ ├── .gitignore ├── .gitmodules ├── CONTRIBUTING.md ├── ClientLibrary/ │ ├── 35MSSharedLib1024.snk │ ├── Contract/ │ │ ├── Accessory.cs │ │ ├── AddPersistedFaceResult.cs │ │ ├── Blur.cs │ │ ├── Candidate.cs │ │ ├── ClientError.cs │ │ ├── CreatePersonResult.cs │ │ ├── Exposure.cs │ │ ├── Face.cs │ │ ├── FaceAttributes.cs │ │ ├── FaceLandmarks.cs │ │ ├── FaceList.cs │ │ ├── FaceListMetadata.cs │ │ ├── FaceMetadata.cs │ │ ├── FaceRectangle.cs │ │ ├── FacialHair.cs │ │ ├── FeatureCoordinate.cs │ │ ├── GlassesTypes.cs │ │ ├── GroupResult.cs │ │ ├── Hair.cs │ │ ├── HeadPose.cs │ │ ├── IdentifyResult.cs │ │ ├── LargeFaceList.cs │ │ ├── LargePersonGroup.cs │ │ ├── Makeup.cs │ │ ├── Noise.cs │ │ ├── Occlusion.cs │ │ ├── PersistedFace.cs │ │ ├── Person.cs │ │ ├── PersonGroup.cs │ │ ├── SimilarFace.cs │ │ ├── SimilarPersistedFace.cs │ │ ├── TrainingStatus.cs │ │ └── VerifyResult.cs │ ├── FaceAPIException.cs │ ├── FaceClientSDK.nuspec │ ├── FaceServiceClient.cs │ ├── IFaceServiceClient.cs │ ├── Microsoft.ProjectOxford.Face.csproj │ ├── Microsoft.ProjectOxford.Face.sln │ ├── Properties/ │ │ └── AssemblyInfo.cs │ └── packages.config ├── LICENSE-IMAGE.md ├── LICENSE.md ├── README.md ├── Sample-WPF/ │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── Controls/ │ │ ├── Face.cs │ │ ├── FaceDetectionPage.xaml │ │ ├── FaceDetectionPage.xaml.cs │ │ ├── FaceFindSimilarPage.xaml │ │ ├── FaceFindSimilarPage.xaml.cs │ │ ├── FaceGroupingPage.xaml │ │ ├── FaceGroupingPage.xaml.cs │ │ ├── FaceIdentificationPage.xaml │ │ ├── FaceIdentificationPage.xaml.cs │ │ ├── FaceVerificationPage.xaml │ │ ├── FaceVerificationPage.xaml.cs │ │ └── UIHelper.cs │ ├── FaceAPI-WPF-Samples.csproj │ ├── FaceAPI-WPF-Samples.sln │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties/ │ │ └── AssemblyInfo.cs │ └── packages.config └── ThirdPartyNotices.txt
SYMBOL INDEX (272 symbols across 45 files)
FILE: ClientLibrary/Contract/Accessory.cs
type AccessoryType (line 42) | [JsonConverter(typeof(StringEnumConverter))]
class Accessory (line 64) | public class Accessory
FILE: ClientLibrary/Contract/AddPersistedFaceResult.cs
class AddPersistedFaceResult (line 41) | public class AddPersistedFaceResult
FILE: ClientLibrary/Contract/Blur.cs
type BlurLevel (line 42) | [JsonConverter(typeof(StringEnumConverter))]
class Blur (line 64) | public class Blur
FILE: ClientLibrary/Contract/Candidate.cs
class Candidate (line 41) | public class Candidate
FILE: ClientLibrary/Contract/ClientError.cs
class ClientError (line 41) | [DataContract]
method ClientError (line 49) | public ClientError()
class ClientExceptionMessage (line 73) | [DataContract]
class ServiceError (line 104) | [DataContract]
method ServiceError (line 112) | public ServiceError()
FILE: ClientLibrary/Contract/CreatePersonResult.cs
class CreatePersonResult (line 41) | public class CreatePersonResult
FILE: ClientLibrary/Contract/Exposure.cs
type ExposureLevel (line 42) | [JsonConverter(typeof(StringEnumConverter))]
class Exposure (line 64) | public class Exposure
FILE: ClientLibrary/Contract/Face.cs
class Face (line 41) | public class Face
FILE: ClientLibrary/Contract/FaceAttributes.cs
class FaceAttributes (line 44) | public class FaceAttributes
FILE: ClientLibrary/Contract/FaceLandmarks.cs
class FaceLandmarks (line 39) | public class FaceLandmarks
FILE: ClientLibrary/Contract/FaceList.cs
class FaceList (line 39) | public class FaceList : FaceListMetadata
FILE: ClientLibrary/Contract/FaceListMetadata.cs
class FaceListMetadata (line 39) | public class FaceListMetadata
FILE: ClientLibrary/Contract/FaceMetadata.cs
class FaceMetadata (line 41) | public class FaceMetadata
FILE: ClientLibrary/Contract/FaceRectangle.cs
class FaceRectangle (line 39) | public class FaceRectangle
FILE: ClientLibrary/Contract/FacialHair.cs
class FacialHair (line 39) | public class FacialHair
FILE: ClientLibrary/Contract/FeatureCoordinate.cs
class FeatureCoordinate (line 39) | public class FeatureCoordinate
FILE: ClientLibrary/Contract/GlassesTypes.cs
type Glasses (line 39) | public enum Glasses
FILE: ClientLibrary/Contract/GroupResult.cs
class GroupResult (line 42) | public class GroupResult
FILE: ClientLibrary/Contract/Hair.cs
type HairColorType (line 42) | [JsonConverter(typeof(StringEnumConverter))]
class HairColor (line 89) | public class HairColor
class Hair (line 111) | public class Hair
FILE: ClientLibrary/Contract/HeadPose.cs
class HeadPose (line 39) | public class HeadPose
FILE: ClientLibrary/Contract/IdentifyResult.cs
class IdentifyResult (line 41) | public class IdentifyResult
FILE: ClientLibrary/Contract/LargeFaceList.cs
class LargeFaceList (line 39) | public class LargeFaceList
FILE: ClientLibrary/Contract/LargePersonGroup.cs
class LargePersonGroup (line 39) | public class LargePersonGroup
FILE: ClientLibrary/Contract/Makeup.cs
class Makeup (line 39) | public class Makeup
FILE: ClientLibrary/Contract/Noise.cs
type NoiseLevel (line 42) | [JsonConverter(typeof(StringEnumConverter))]
class Noise (line 64) | public class Noise
FILE: ClientLibrary/Contract/Occlusion.cs
class Occlusion (line 39) | public class Occlusion
FILE: ClientLibrary/Contract/PersistedFace.cs
class PersistedFace (line 41) | public class PersistedFace
FILE: ClientLibrary/Contract/Person.cs
class Person (line 41) | public class Person
FILE: ClientLibrary/Contract/PersonGroup.cs
class PersonGroup (line 39) | public class PersonGroup
FILE: ClientLibrary/Contract/SimilarFace.cs
class SimilarFace (line 41) | public class SimilarFace
FILE: ClientLibrary/Contract/SimilarPersistedFace.cs
class SimilarPersistedFace (line 41) | public class SimilarPersistedFace
FILE: ClientLibrary/Contract/TrainingStatus.cs
type Status (line 43) | public enum Status
class TrainingStatus (line 66) | public class TrainingStatus
FILE: ClientLibrary/Contract/VerifyResult.cs
class VerifyResult (line 39) | public class VerifyResult
FILE: ClientLibrary/FaceAPIException.cs
class FaceAPIException (line 42) | public class FaceAPIException : Exception
method FaceAPIException (line 49) | public FaceAPIException()
method FaceAPIException (line 59) | public FaceAPIException(string errorCode, string errorMessage, HttpSta...
FILE: ClientLibrary/FaceServiceClient.cs
class FaceServiceClient (line 54) | public class FaceServiceClient : IDisposable, IFaceServiceClient
method FaceServiceClient (line 176) | public FaceServiceClient(string subscriptionKey) : this(subscriptionKe...
method FaceServiceClient (line 183) | public FaceServiceClient(string subscriptionKey, string apiRoot)
method DetectAsync (line 231) | public async Task<Face[]> DetectAsync(string imageUrl, bool returnFace...
method DetectAsync (line 257) | public async Task<Face[]> DetectAsync(Stream imageStream, bool returnF...
method FindSimilarAsync (line 284) | public async Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] ...
method FindSimilarAsync (line 299) | public async Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] ...
method FindSimilarAsync (line 324) | public async Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId...
method FindSimilarAsync (line 339) | public async Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId...
method FindSimilarAsync (line 355) | public async Task<SimilarPersistedFace[]> FindSimilarAsync(
method GroupAsync (line 384) | public async Task<GroupResult> GroupAsync(Guid[] faceIds)
method IdentifyAsync (line 404) | public async Task<IdentifyResult[]> IdentifyAsync(string personGroupId...
method IdentifyAsync (line 417) | public async Task<IdentifyResult[]> IdentifyAsync(string personGroupId...
method IdentifyAsync (line 431) | public async Task<IdentifyResult[]> IdentifyAsync(
method VerifyAsync (line 459) | public async Task<VerifyResult> VerifyAsync(Guid faceId1, Guid faceId2)
method VerifyAsync (line 480) | public async Task<VerifyResult> VerifyAsync(Guid faceId, string person...
method VerifyAsync (line 493) | public async Task<VerifyResult> VerifyAsync(
method CreateFaceListAsync (line 526) | public async Task CreateFaceListAsync(string faceListId, string name, ...
method DeleteFaceListAsync (line 547) | public async Task DeleteFaceListAsync(string faceListId)
method GetFaceListAsync (line 561) | public async Task<FaceList> GetFaceListAsync(string faceListId)
method ListFaceListsAsync (line 574) | public async Task<FaceListMetadata[]> ListFaceListsAsync()
method UpdateFaceListAsync (line 590) | public async Task UpdateFaceListAsync(string faceListId, string name, ...
method AddFaceToFaceListAsync (line 618) | public async Task<AddPersistedFaceResult> AddFaceToFaceListAsync(
method AddFaceToFaceListAsync (line 646) | public async Task<AddPersistedFaceResult> AddFaceToFaceListAsync(
method DeleteFaceFromFaceListAsync (line 670) | public async Task DeleteFaceFromFaceListAsync(string faceListId, Guid ...
method CreatePersonGroupAsync (line 689) | public async Task CreatePersonGroupAsync(string personGroupId, string ...
method DeletePersonGroupAsync (line 708) | public async Task DeletePersonGroupAsync(string personGroupId)
method GetPersonGroupAsync (line 720) | public async Task<PersonGroup> GetPersonGroupAsync(string personGroupId)
method GetPersonGroupTrainingStatusAsync (line 732) | public async Task<TrainingStatus> GetPersonGroupTrainingStatusAsync(st...
method GetPersonGroupsAsync (line 743) | [Obsolete("use ListPersonGroupsAsync instead")]
method ListPersonGroupsAsync (line 755) | public async Task<PersonGroup[]> ListPersonGroupsAsync(string start = ...
method TrainPersonGroupAsync (line 768) | public async Task TrainPersonGroupAsync(string personGroupId)
method UpdatePersonGroupAsync (line 782) | public async Task UpdatePersonGroupAsync(string personGroupId, string ...
method CreatePersonAsync (line 807) | public async Task<CreatePersonResult> CreatePersonAsync(
method CreatePersonInPersonGroupAsync (line 822) | public async Task<CreatePersonResult> CreatePersonInPersonGroupAsync(
method DeletePersonAsync (line 841) | public async Task DeletePersonAsync(string personGroupId, Guid personId)
method DeletePersonFromPersonGroupAsync (line 852) | public async Task DeletePersonFromPersonGroupAsync(string personGroupI...
method GetPersonAsync (line 864) | public async Task<Person> GetPersonAsync(string personGroupId, Guid pe...
method GetPersonInPersonGroupAsync (line 875) | public async Task<Person> GetPersonInPersonGroupAsync(string personGro...
method GetPersonsAsync (line 889) | [Obsolete("use ListPersonsAsync instead")]
method ListPersonsAsync (line 904) | public async Task<Person[]> ListPersonsAsync(string personGroupId, str...
method ListPersonsInPersonGroupAsync (line 918) | public async Task<Person[]> ListPersonsInPersonGroupAsync(
method UpdatePersonAsync (line 937) | public async Task UpdatePersonAsync(string personGroupId, Guid personI...
method UpdatePersonInPersonGroupAsync (line 950) | public async Task UpdatePersonInPersonGroupAsync(
method AddPersonFaceAsync (line 979) | public async Task<AddPersistedFaceResult> AddPersonFaceAsync(
method AddPersonFaceInPersonGroupAsync (line 1000) | public async Task<AddPersistedFaceResult> AddPersonFaceInPersonGroupAs...
method AddPersonFaceAsync (line 1030) | public async Task<AddPersistedFaceResult> AddPersonFaceAsync(
method AddPersonFaceInPersonGroupAsync (line 1056) | public async Task<AddPersistedFaceResult> AddPersonFaceInPersonGroupAs...
method DeletePersonFaceAsync (line 1084) | public async Task DeletePersonFaceAsync(string personGroupId, Guid per...
method DeletePersonFaceFromPersonGroupAsync (line 1098) | public async Task DeletePersonFaceFromPersonGroupAsync(
method GetPersonFaceAsync (line 1118) | public async Task<PersistedFace> GetPersonFaceAsync(string personGroup...
method GetPersonFaceInPersonGroupAsync (line 1132) | public async Task<PersistedFace> GetPersonFaceInPersonGroupAsync(strin...
method UpdatePersonFaceAsync (line 1150) | public async Task UpdatePersonFaceAsync(
method UpdatePersonFaceInPersonGroupAsync (line 1169) | public async Task UpdatePersonFaceInPersonGroupAsync(
method CreateLargeFaceListAsync (line 1195) | public async Task CreateLargeFaceListAsync(string largeFaceListId, str...
method DeleteLargeFaceListAsync (line 1211) | public async Task DeleteLargeFaceListAsync(string largeFaceListId)
method GetLargeFaceListAsync (line 1223) | public async Task<LargeFaceList> GetLargeFaceListAsync(string largeFac...
method GetLargeFaceListTrainingStatusAsync (line 1235) | public async Task<TrainingStatus> GetLargeFaceListTrainingStatusAsync(...
method ListLargeFaceListsAsync (line 1248) | public async Task<LargeFaceList[]> ListLargeFaceListsAsync(string star...
method TrainLargeFaceListAsync (line 1261) | public async Task TrainLargeFaceListAsync(string largeFaceListId)
method UpdateLargeFaceListAsync (line 1275) | public async Task UpdateLargeFaceListAsync(string largeFaceListId, str...
method AddFaceToLargeFaceListAsync (line 1299) | public async Task<AddPersistedFaceResult> AddFaceToLargeFaceListAsync(
method AddFaceToLargeFaceListAsync (line 1327) | public async Task<AddPersistedFaceResult> AddFaceToLargeFaceListAsync(
method DeleteFaceFromLargeFaceListAsync (line 1351) | public async Task DeleteFaceFromLargeFaceListAsync(string largeFaceLis...
method GetFaceInLargeFaceListAsync (line 1365) | public async Task<PersistedFace> GetFaceInLargeFaceListAsync(string la...
method ListFacesInLargeFaceListAsync (line 1380) | public async Task<PersistedFace[]> ListFacesInLargeFaceListAsync(
method UpdateFaceInLargeFaceListAsync (line 1398) | public async Task UpdateFaceInLargeFaceListAsync(string largeFaceListI...
method CreateLargePersonGroupAsync (line 1420) | public async Task CreateLargePersonGroupAsync(string largePersonGroupI...
method DeleteLargePersonGroupAsync (line 1435) | public async Task DeleteLargePersonGroupAsync(string largePersonGroupId)
method GetLargePersonGroupAsync (line 1447) | public async Task<LargePersonGroup> GetLargePersonGroupAsync(string la...
method GetLargePersonGroupTrainingStatusAsync (line 1459) | public async Task<TrainingStatus> GetLargePersonGroupTrainingStatusAsy...
method ListLargePersonGroupsAsync (line 1472) | public async Task<LargePersonGroup[]> ListLargePersonGroupsAsync(strin...
method TrainLargePersonGroupAsync (line 1485) | public async Task TrainLargePersonGroupAsync(string largePersonGroupId)
method UpdateLargePersonGroupAsync (line 1499) | public async Task UpdateLargePersonGroupAsync(string largePersonGroupI...
method CreatePersonInLargePersonGroupAsync (line 1520) | public async Task<CreatePersonResult> CreatePersonInLargePersonGroupAs...
method DeletePersonFromLargePersonGroupAsync (line 1539) | public async Task DeletePersonFromLargePersonGroupAsync(string largePe...
method GetPersonInLargePersonGroupAsync (line 1552) | public async Task<Person> GetPersonInLargePersonGroupAsync(string larg...
method ListPersonsInLargePersonGroupAsync (line 1566) | public async Task<Person[]> ListPersonsInLargePersonGroupAsync(
method UpdatePersonInLargePersonGroupAsync (line 1585) | public async Task UpdatePersonInLargePersonGroupAsync(
method AddPersonFaceInLargePersonGroupAsync (line 1615) | public async Task<AddPersistedFaceResult> AddPersonFaceInLargePersonGr...
method AddPersonFaceInLargePersonGroupAsync (line 1645) | public async Task<AddPersistedFaceResult> AddPersonFaceInLargePersonGr...
method DeletePersonFaceFromLargePersonGroupAsync (line 1671) | public async Task DeletePersonFaceFromLargePersonGroupAsync(
method GetPersonFaceInLargePersonGroupAsync (line 1689) | public async Task<PersistedFace> GetPersonFaceInLargePersonGroupAsync(
method UpdatePersonFaceInLargePersonGroupAsync (line 1708) | public async Task UpdatePersonFaceInLargePersonGroupAsync(
method GetAttributeString (line 1732) | public static string GetAttributeString(IEnumerable<FaceAttributeType>...
method Dispose (line 1744) | public void Dispose()
method Dispose (line 1754) | protected virtual void Dispose(bool disposing)
method SendRequestAsync (line 1776) | private async Task<TResponse> SendRequestAsync<TRequest, TResponse>(Ht...
FILE: ClientLibrary/IFaceServiceClient.cs
type FaceAttributeType (line 50) | public enum FaceAttributeType
type FindSimilarMatchMode (line 126) | public enum FindSimilarMatchMode
type IFaceServiceClient (line 144) | public interface IFaceServiceClient
method DetectAsync (line 168) | Task<Face[]> DetectAsync(string imageUrl, bool returnFaceId = true, bo...
method DetectAsync (line 178) | Task<Face[]> DetectAsync(Stream imageStream, bool returnFaceId = true,...
method FindSimilarAsync (line 189) | Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] faceIds, int ...
method FindSimilarAsync (line 201) | Task<SimilarFace[]> FindSimilarAsync(Guid faceId, Guid[] faceIds, Find...
method FindSimilarAsync (line 212) | [Obsolete("use the FindSimilarAsync support both Face List and Large F...
method FindSimilarAsync (line 225) | [Obsolete("use the FindSimilarAsync support both Face List and Large F...
method FindSimilarAsync (line 239) | Task<SimilarPersistedFace[]> FindSimilarAsync(Guid faceId, string face...
method GroupAsync (line 246) | Task<GroupResult> GroupAsync(Guid[] faceIds);
method IdentifyAsync (line 255) | [Obsolete("use the IdentifyAsync support both Person Group and Large P...
method IdentifyAsync (line 266) | [Obsolete("use the IdentifyAsync support both Person Group and Large P...
method IdentifyAsync (line 278) | Task<IdentifyResult[]> IdentifyAsync(Guid[] faceIds, string personGrou...
method VerifyAsync (line 286) | Task<VerifyResult> VerifyAsync(Guid faceId1, Guid faceId2);
method VerifyAsync (line 295) | [Obsolete("use the VerifyAsync supports both Person Group and Large Pe...
method VerifyAsync (line 306) | Task<VerifyResult> VerifyAsync(Guid faceId, Guid personId, string pers...
method CreateFaceListAsync (line 319) | Task CreateFaceListAsync(string faceListId, string name, string userDa...
method DeleteFaceListAsync (line 326) | Task DeleteFaceListAsync(string faceListId);
method GetFaceListAsync (line 333) | Task<FaceList> GetFaceListAsync(string faceListId);
method ListFaceListsAsync (line 339) | Task<FaceListMetadata[]> ListFaceListsAsync();
method UpdateFaceListAsync (line 348) | Task UpdateFaceListAsync(string faceListId, string name, string userDa...
method AddFaceToFaceListAsync (line 364) | Task<AddPersistedFaceResult> AddFaceToFaceListAsync(string faceListId,...
method AddFaceToFaceListAsync (line 376) | Task<AddPersistedFaceResult> AddFaceToFaceListAsync(string faceListId,...
method DeleteFaceFromFaceListAsync (line 384) | Task DeleteFaceFromFaceListAsync(string faceListId, Guid persistedFace...
method CreatePersonGroupAsync (line 397) | Task CreatePersonGroupAsync(string personGroupId, string name, string ...
method DeletePersonGroupAsync (line 404) | Task DeletePersonGroupAsync(string personGroupId);
method GetPersonGroupAsync (line 411) | Task<PersonGroup> GetPersonGroupAsync(string personGroupId);
method GetPersonGroupTrainingStatusAsync (line 418) | Task<TrainingStatus> GetPersonGroupTrainingStatusAsync(string personGr...
method GetPersonGroupsAsync (line 424) | [Obsolete("use ListPersonGroupsAsync instead")]
method ListPersonGroupsAsync (line 433) | Task<PersonGroup[]> ListPersonGroupsAsync(string start = "", int top =...
method TrainPersonGroupAsync (line 440) | Task TrainPersonGroupAsync(string personGroupId);
method UpdatePersonGroupAsync (line 449) | Task UpdatePersonGroupAsync(string personGroupId, string name, string ...
method CreatePersonAsync (line 462) | [Obsolete("use CreatePersonInPersonGroupAsync instead")]
method CreatePersonInPersonGroupAsync (line 472) | Task<CreatePersonResult> CreatePersonInPersonGroupAsync(string personG...
method DeletePersonAsync (line 480) | [Obsolete("use DeletePersonFromPersonGroupAsync instead")]
method DeletePersonFromPersonGroupAsync (line 489) | Task DeletePersonFromPersonGroupAsync(string personGroupId, Guid perso...
method GetPersonAsync (line 497) | [Obsolete("use GetPersonInPersonGroupAsync instead")]
method GetPersonInPersonGroupAsync (line 506) | Task<Person> GetPersonInPersonGroupAsync(string personGroupId, Guid pe...
method GetPersonsAsync (line 515) | [Obsolete("use ListPersonsInPersonGroupAsync instead")]
method ListPersonsAsync (line 525) | [Obsolete("use ListPersonsInPersonGroupAsync instead")]
method ListPersonsInPersonGroupAsync (line 535) | Task<Person[]> ListPersonsInPersonGroupAsync(string personGroupId, str...
method UpdatePersonAsync (line 545) | [Obsolete("use UpdatePersonInPersonGroupAsync instead")]
method UpdatePersonInPersonGroupAsync (line 556) | Task UpdatePersonInPersonGroupAsync(string personGroupId, Guid personI...
method AddPersonFaceAsync (line 573) | [Obsolete("use AddPersonFaceInPersonGroupAsync instead")]
method AddPersonFaceInPersonGroupAsync (line 587) | Task<AddPersistedFaceResult> AddPersonFaceInPersonGroupAsync(string pe...
method AddPersonFaceAsync (line 600) | [Obsolete("use AddPersonFaceInPersonGroupAsync instead")]
method AddPersonFaceInPersonGroupAsync (line 614) | Task<AddPersistedFaceResult> AddPersonFaceInPersonGroupAsync(string pe...
method DeletePersonFaceAsync (line 623) | [Obsolete("use DeletePersonFaceFromPersonGroupAsync instead")]
method DeletePersonFaceFromPersonGroupAsync (line 633) | Task DeletePersonFaceFromPersonGroupAsync(string personGroupId, Guid p...
method GetPersonFaceAsync (line 642) | [Obsolete("use GetPersonFaceInPersonGroupAsync instead")]
method GetPersonFaceInPersonGroupAsync (line 652) | Task<PersistedFace> GetPersonFaceInPersonGroupAsync(string personGroup...
method UpdatePersonFaceAsync (line 662) | [Obsolete("use UpdatePersonFaceInPersonGroupAsync instead")]
method UpdatePersonFaceInPersonGroupAsync (line 673) | Task UpdatePersonFaceInPersonGroupAsync(string personGroupId, Guid per...
method CreateLargeFaceListAsync (line 686) | Task CreateLargeFaceListAsync(string largeFaceListId, string name, str...
method DeleteLargeFaceListAsync (line 693) | Task DeleteLargeFaceListAsync(string largeFaceListId);
method GetLargeFaceListAsync (line 700) | Task<LargeFaceList> GetLargeFaceListAsync(string largeFaceListId);
method GetLargeFaceListTrainingStatusAsync (line 707) | Task<TrainingStatus> GetLargeFaceListTrainingStatusAsync(string largeF...
method ListLargeFaceListsAsync (line 715) | Task<LargeFaceList[]> ListLargeFaceListsAsync(string start = "", int t...
method TrainLargeFaceListAsync (line 722) | Task TrainLargeFaceListAsync(string largeFaceListId);
method UpdateLargeFaceListAsync (line 731) | Task UpdateLargeFaceListAsync(string largeFaceListId, string name, str...
method AddFaceToLargeFaceListAsync (line 747) | Task<AddPersistedFaceResult> AddFaceToLargeFaceListAsync(string largeF...
method AddFaceToLargeFaceListAsync (line 759) | Task<AddPersistedFaceResult> AddFaceToLargeFaceListAsync(string largeF...
method DeleteFaceFromLargeFaceListAsync (line 767) | Task DeleteFaceFromLargeFaceListAsync(string largeFaceListId, Guid per...
method GetFaceInLargeFaceListAsync (line 775) | Task<PersistedFace> GetFaceInLargeFaceListAsync(string largeFaceListId...
method ListFacesInLargeFaceListAsync (line 784) | Task<PersistedFace[]> ListFacesInLargeFaceListAsync(string largeFaceLi...
method UpdateFaceInLargeFaceListAsync (line 793) | Task UpdateFaceInLargeFaceListAsync(string largeFaceListId, Guid persi...
method CreateLargePersonGroupAsync (line 806) | Task CreateLargePersonGroupAsync(string largePersonGroupId, string nam...
method DeleteLargePersonGroupAsync (line 813) | Task DeleteLargePersonGroupAsync(string largePersonGroupId);
method GetLargePersonGroupAsync (line 820) | Task<LargePersonGroup> GetLargePersonGroupAsync(string largePersonGrou...
method GetLargePersonGroupTrainingStatusAsync (line 827) | Task<TrainingStatus> GetLargePersonGroupTrainingStatusAsync(string lar...
method ListLargePersonGroupsAsync (line 835) | Task<LargePersonGroup[]> ListLargePersonGroupsAsync(string start = "",...
method TrainLargePersonGroupAsync (line 842) | Task TrainLargePersonGroupAsync(string largePersonGroupId);
method UpdateLargePersonGroupAsync (line 851) | Task UpdateLargePersonGroupAsync(string largePersonGroupId, string nam...
method CreatePersonInLargePersonGroupAsync (line 864) | Task<CreatePersonResult> CreatePersonInLargePersonGroupAsync(string la...
method DeletePersonFromLargePersonGroupAsync (line 872) | Task DeletePersonFromLargePersonGroupAsync(string largePersonGroupId, ...
method GetPersonInLargePersonGroupAsync (line 880) | Task<Person> GetPersonInLargePersonGroupAsync(string largePersonGroupI...
method ListPersonsInLargePersonGroupAsync (line 889) | Task<Person[]> ListPersonsInLargePersonGroupAsync(string largePersonGr...
method UpdatePersonInLargePersonGroupAsync (line 899) | Task UpdatePersonInLargePersonGroupAsync(string largePersonGroupId, Gu...
method AddPersonFaceInLargePersonGroupAsync (line 916) | Task<AddPersistedFaceResult> AddPersonFaceInLargePersonGroupAsync(stri...
method AddPersonFaceInLargePersonGroupAsync (line 929) | Task<AddPersistedFaceResult> AddPersonFaceInLargePersonGroupAsync(stri...
method DeletePersonFaceFromLargePersonGroupAsync (line 938) | Task DeletePersonFaceFromLargePersonGroupAsync(string largePersonGroup...
method GetPersonFaceInLargePersonGroupAsync (line 947) | Task<PersistedFace> GetPersonFaceInLargePersonGroupAsync(string largeP...
method UpdatePersonFaceInLargePersonGroupAsync (line 957) | Task UpdatePersonFaceInLargePersonGroupAsync(string largePersonGroupId...
FILE: Sample-WPF/App.xaml.cs
class App (line 41) | public partial class App : Application
method App (line 48) | private App()
method App_DispatcherUnhandledException (line 62) | private void App_DispatcherUnhandledException(object sender, System.Wi...
FILE: Sample-WPF/Controls/Face.cs
class Face (line 43) | public class Face : INotifyPropertyChanged
method OnPropertyChanged (line 516) | private void OnPropertyChanged<T>([CallerMemberName]string caller = null)
FILE: Sample-WPF/Controls/FaceDetectionPage.xaml.cs
class FaceDetectionPage (line 48) | public partial class FaceDetectionPage : Page, INotifyPropertyChanged
method FaceDetectionPage (line 85) | public FaceDetectionPage()
method ImagePicker_Click (line 201) | private async void ImagePicker_Click(object sender, RoutedEventArgs e)
method GetHair (line 285) | private string GetHair(Contract.Hair hair)
method GetAccessories (line 312) | private string GetAccessories(Contract.Accessory[] accessories)
method GetEmotion (line 329) | private string GetEmotion(Microsoft.ProjectOxford.Common.Contract.Emot...
FILE: Sample-WPF/Controls/FaceFindSimilarPage.xaml.cs
class FaceFindSimilarPage (line 55) | public partial class FaceFindSimilarPage : Page, INotifyPropertyChanged
method FaceFindSimilarPage (line 107) | public FaceFindSimilarPage()
method FindSimilar_Click (line 225) | private async void FindSimilar_Click(object sender, RoutedEventArgs e)
method FolderPicker_Click (line 357) | private async void FolderPicker_Click(object sender, RoutedEventArgs e)
class FindSimilarResult (line 558) | public class FindSimilarResult : INotifyPropertyChanged
FILE: Sample-WPF/Controls/FaceGroupingPage.xaml.cs
class FaceGroupingPage (line 53) | public partial class FaceGroupingPage : Page
method FaceGroupingPage (line 85) | public FaceGroupingPage()
method Grouping_Click (line 142) | private async void Grouping_Click(object sender, RoutedEventArgs e)
class GroupingResult (line 302) | public class GroupingResult : INotifyPropertyChanged
FILE: Sample-WPF/Controls/FaceIdentificationPage.xaml.cs
class FaceIdentificationPage (line 56) | public partial class FaceIdentificationPage : Page, INotifyPropertyChanged
method FaceIdentificationPage (line 97) | public FaceIdentificationPage()
method FolderPicker_Click (line 212) | private async void FolderPicker_Click(object sender, RoutedEventArgs e)
method Identify_Click (line 432) | private async void Identify_Click(object sender, RoutedEventArgs e)
class IdentificationResult (line 514) | public class IdentificationResult : INotifyPropertyChanged
class Person (line 587) | public class Person : INotifyPropertyChanged
FILE: Sample-WPF/Controls/FaceVerificationPage.xaml.cs
class FaceVerificationPage (line 57) | public partial class FaceVerificationPage : Page, INotifyPropertyChanged
method FaceVerificationPage (line 113) | public FaceVerificationPage()
method LeftImagePicker_Click (line 273) | private async void LeftImagePicker_Click(object sender, RoutedEventArg...
method RightImagePicker_Click (line 340) | private async void RightImagePicker_Click(object sender, RoutedEventAr...
method Face2FaceVerification_Click (line 409) | private async void Face2FaceVerification_Click(object sender, RoutedEv...
method PersonImageFolderPicker_Click (line 455) | private async void PersonImageFolderPicker_Click(object sender, Routed...
method FaceImagePicker_Click (line 659) | private async void FaceImagePicker_Click(object sender, RoutedEventArg...
method Face2PersonVerification_Click (line 728) | private async void Face2PersonVerification_Click(object sender, Routed...
class Person (line 774) | public class Person : INotifyPropertyChanged
FILE: Sample-WPF/Controls/UIHelper.cs
class UIHelper (line 48) | internal static class UIHelper
method LoadImageAppliedOrientation (line 57) | public static BitmapImage LoadImageAppliedOrientation(string imagePath)
method GetImageOrientation (line 72) | public static Rotation GetImageOrientation(string imagePath)
method CalculateFaceRectangleForRendering (line 108) | public static IEnumerable<Face> CalculateFaceRectangleForRendering(IEn...
method GetImageInfoForRendering (line 148) | public static Tuple<int, int> GetImageInfoForRendering(BitmapImage ima...
method UpdateFace (line 166) | public static void UpdateFace(ObservableCollection<Face> collections, ...
method UpdateFace (line 182) | public static void UpdateFace(ObservableCollection<Face> collections, ...
method AppendLine (line 202) | public static string AppendLine(this string log, string newMessage)
class ControlHelper (line 210) | public static class ControlHelper
method SetPassMouseWheelToParent (line 216) | public static void SetPassMouseWheelToParent(UIElement obj, bool value)
method GetPassMouseWheelToParent (line 229) | public static bool GetPassMouseWheelToParent(UIElement obj)
method Obj_PreviewMouseWheel (line 234) | private static void Obj_PreviewMouseWheel(object sender, System.Window...
method FindVisualParent (line 255) | public static T FindVisualParent<T>(DependencyObject child)
FILE: Sample-WPF/MainWindow.xaml.cs
class MainWindow (line 48) | public partial class MainWindow
method MainWindow (line 61) | public MainWindow()
method Log (line 133) | public static void Log(string format, params object[] args)
class MainViewModel (line 145) | public class MainViewModel : INotifyPropertyChanged
method OnPropertyChanged (line 230) | private void OnPropertyChanged<T>([CallerMemberName]string caller = ...
Condensed preview — 70 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (534K chars).
[
{
"path": ".gitignore",
"chars": 4222,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
},
{
"path": ".gitmodules",
"chars": 137,
"preview": "[submodule \"Cognitive-Common-Windows\"]\n\tpath = Cognitive-Common-Windows\n\turl = https://github.com/Microsoft/Cognitive-Co"
},
{
"path": "CONTRIBUTING.md",
"chars": 1920,
"preview": "Contributing to Microsoft Cognitive Services Client Libraries & Samples\n===============================================\n"
},
{
"path": "ClientLibrary/Contract/Accessory.cs",
"chars": 2533,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/AddPersistedFaceResult.cs",
"chars": 2027,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Blur.cs",
"chars": 2829,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Candidate.cs",
"chars": 2222,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/ClientError.cs",
"chars": 3897,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Service"
},
{
"path": "ClientLibrary/Contract/CreatePersonResult.cs",
"chars": 1993,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Exposure.cs",
"chars": 2848,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Face.cs",
"chars": 2748,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FaceAttributes.cs",
"chars": 5157,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FaceLandmarks.cs",
"chars": 8598,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FaceList.cs",
"chars": 1971,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FaceListMetadata.cs",
"chars": 2407,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FaceMetadata.cs",
"chars": 2179,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FaceRectangle.cs",
"chars": 2600,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FacialHair.cs",
"chars": 2543,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/FeatureCoordinate.cs",
"chars": 2199,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/GlassesTypes.cs",
"chars": 2126,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/GroupResult.cs",
"chars": 2350,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Hair.cs",
"chars": 3576,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/HeadPose.cs",
"chars": 2390,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/IdentifyResult.cs",
"chars": 2196,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/LargeFaceList.cs",
"chars": 2418,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/LargePersonGroup.cs",
"chars": 2460,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Makeup.cs",
"chars": 2064,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Noise.cs",
"chars": 2834,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Occlusion.cs",
"chars": 2267,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/PersistedFace.cs",
"chars": 2227,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/Person.cs",
"chars": 2653,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/PersonGroup.cs",
"chars": 2426,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/SimilarFace.cs",
"chars": 2189,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/SimilarPersistedFace.cs",
"chars": 2249,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/TrainingStatus.cs",
"chars": 3416,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Contract/VerifyResult.cs",
"chars": 2252,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/FaceAPIException.cs",
"chars": 3286,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/FaceClientSDK.nuspec",
"chars": 1291,
"preview": "<?xml version=\"1.0\"?>\n<package>\n <metadata>\n <id>Microsoft.ProjectOxford.Face</id>\n <title>Microsoft Cognitive Se"
},
{
"path": "ClientLibrary/FaceServiceClient.cs",
"chars": 77926,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/IFaceServiceClient.cs",
"chars": 43852,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/Microsoft.ProjectOxford.Face.csproj",
"chars": 5248,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micro"
},
{
"path": "ClientLibrary/Microsoft.ProjectOxford.Face.sln",
"chars": 998,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.25123.0\nMini"
},
{
"path": "ClientLibrary/Properties/AssemblyInfo.cs",
"chars": 1976,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "ClientLibrary/packages.config",
"chars": 273,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.ProjectOxford.Common\" version=\"1.0.324\" targ"
},
{
"path": "LICENSE-IMAGE.md",
"chars": 1018,
"preview": "Copyright (c) Microsoft Corporation\n\nAll rights reserved.\n\nMicrosoft Cognitive Services Client SDK License for Sample Im"
},
{
"path": "LICENSE.md",
"chars": 1268,
"preview": "Microsoft Cognitive Services SDK\n\nCopyright (c) Microsoft Corporation\n\nAll rights reserved.\n\n*This license applies only "
},
{
"path": "README.md",
"chars": 4480,
"preview": "# This repository has been retired. Please visit the [Face QuickStart](https://docs.microsoft.com/en-us/azure/cognitive-"
},
{
"path": "Sample-WPF/App.config",
"chars": 527,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <startup> \n <supportedRuntime version=\"v4.0\" sku=\".NE"
},
{
"path": "Sample-WPF/App.xaml",
"chars": 329,
"preview": "<Application x:Class=\"Microsoft.ProjectOxford.Face.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xam"
},
{
"path": "Sample-WPF/App.xaml.cs",
"chars": 3070,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/Face.cs",
"chars": 12661,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/FaceDetectionPage.xaml",
"chars": 14125,
"preview": "<!--\n//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive S"
},
{
"path": "Sample-WPF/Controls/FaceDetectionPage.xaml.cs",
"chars": 14549,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/FaceFindSimilarPage.xaml",
"chars": 39076,
"preview": "<!--\n//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive S"
},
{
"path": "Sample-WPF/Controls/FaceFindSimilarPage.xaml.cs",
"chars": 25498,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/FaceGroupingPage.xaml",
"chars": 18028,
"preview": "<!--\n//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive S"
},
{
"path": "Sample-WPF/Controls/FaceGroupingPage.xaml.cs",
"chars": 13792,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/FaceIdentificationPage.xaml",
"chars": 15124,
"preview": "<!--\n//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive S"
},
{
"path": "Sample-WPF/Controls/FaceIdentificationPage.xaml.cs",
"chars": 25668,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/FaceVerificationPage.xaml",
"chars": 16095,
"preview": "<!--\n//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive S"
},
{
"path": "Sample-WPF/Controls/FaceVerificationPage.xaml.cs",
"chars": 35074,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Controls/UIHelper.cs",
"chars": 10897,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/FaceAPI-WPF-Samples.csproj",
"chars": 9661,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Sample-WPF/FaceAPI-WPF-Samples.sln",
"chars": 1576,
"preview": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.23107.0\nMinimu"
},
{
"path": "Sample-WPF/MainWindow.xaml",
"chars": 728,
"preview": "<Window x:Class=\"Microsoft.ProjectOxford.Face.MainWindow\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/p"
},
{
"path": "Sample-WPF/MainWindow.xaml.cs",
"chars": 9741,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/Properties/AssemblyInfo.cs",
"chars": 3792,
"preview": "//\n// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license.\n//\n// Microsoft Cognitive Servic"
},
{
"path": "Sample-WPF/packages.config",
"chars": 556,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Microsoft.Bcl\" version=\"1.1.10\" targetFramework=\"net45"
},
{
"path": "ThirdPartyNotices.txt",
"chars": 1715,
"preview": "THIRD-PARTY SOFTWARE NOTICES AND INFORMATION\nDo Not Translate or Localize\n\nThis project incorporates components from the"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the Microsoft/Cognitive-Face-Windows GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 70 files (499.0 KB), approximately 100.3k tokens, and a symbol index with 272 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.