Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Commit

Permalink
Build2017 new features (#24)
Browse files Browse the repository at this point in the history
* Add emotion support for SDK and Sample.

* Update according to comments and version number change.

* Update Cognitive-Common-Windows submodule.

* reference common package

* make userData as optional for CreateFaceListAsync

* merge from Microsoft/Cognitive-Face-Windows (#2)

* Add facial hair and head pose in sample. (#15)

* Comments add and code style improve. (#16)

* Endpoint change. (#20)

* update the Client Library for endpoint change

update the Client Library for endpoint change

* revert the changes to packages.config

revert the changes to packages.config

* update namespace to CognitiveServices for Client SDK

update namespace to CognitiveServices for Client SDK

* update sample code namespace.

update sample code namespace.

* update assembly version as 1.2.5

update assembly version as 1.2.5

* update assembly version as 1.2.5

update assembly version as 1.2.5

* Assembly copyright update

* add blank spaces

* Enable new face attributes

* Support new attributes in detection for BUILD2017.
Fix rotate image display bug.

* Fix list person group and persons bug

* Remove useless blank in blur.cs

* Add ListpersonsAsync interface

* Update version for Build2017

* Code optimization

* Remove empty line

* Support list persons by top parameter only.

* Support list person group by top parameter only

* Remove listPersons by parameter "top" interface.

* Remove listPersonGroups by parameter "top" interface.

* rename as "ProjectOxford"

* change revert

* revert changes

* Fix comments for clientlib

* Fix comments for Sample.

* Fix comments for Face.cs

* Remove blanks

* Remove blank

* Change version in .csproj

* Remove blank

* Remove blank

* revert name space change

* revert change

* revert change

* revert change

* revert change

* update the Microsoft.ProjectOxford.Face version

* update reference

* revert change

* revert

* Change new attributes contract namespace.

* Fix bugs

* Version update

* Refine new attributes' comments.

* Hair color type change in sample.

* version change for BUILD2017

* Support more attributes display in demo page,

* Support display glasses type.

* Remove useless blank in demo

* Change display format.

* Change version.

* Sample photos change
  • Loading branch information
sldi-microsoft authored and huxuan committed May 8, 2017
1 parent 55bfa89 commit 71cc279
Show file tree
Hide file tree
Showing 32 changed files with 1,181 additions and 126 deletions.
86 changes: 86 additions & 0 deletions ClientLibrary/Contract/Accessory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// 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
}
}
89 changes: 89 additions & 0 deletions ClientLibrary/Contract/Blur.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//
// 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
}
}
89 changes: 89 additions & 0 deletions ClientLibrary/Contract/Exposure.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//
// 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
}
}
77 changes: 77 additions & 0 deletions ClientLibrary/Contract/FaceAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,83 @@ 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
}
}
Loading

0 comments on commit 71cc279

Please sign in to comment.