This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Microsoft Cognitive Services SDK Release - March 2016
- Loading branch information
1 parent
20eb322
commit 32db62a
Showing
1,838 changed files
with
67,184 additions
and
32,175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// | ||
// 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/ProjectOxford-ClientSDK | ||
// | ||
// 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.Common | ||
{ | ||
/// <summary> | ||
/// Container of ClientError and Error Entity. | ||
/// </summary> | ||
public class ClientError | ||
{ | ||
/// <summary> | ||
/// Gets or sets error code in error entity. | ||
/// </summary> | ||
/// <value> | ||
/// The code of client error. | ||
/// </value> | ||
public string Code | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the message. | ||
/// </summary> | ||
/// <value> | ||
/// The message. | ||
/// </value> | ||
public string Message | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the request identifier. | ||
/// </summary> | ||
/// <value> | ||
/// The request identifier. | ||
/// </value> | ||
public Guid RequestId | ||
{ | ||
get; | ||
set; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
// | ||
// 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/ProjectOxford-ClientSDK | ||
// | ||
// 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.Common | ||
{ | ||
/// <summary> | ||
/// The Exception will be shown to client. | ||
/// </summary> | ||
public class ClientException : Exception | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ClientException"/> class. | ||
/// </summary> | ||
public ClientException() | ||
: base() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ClientException"/> class. | ||
/// </summary> | ||
/// <param name="message">The corresponding error message.</param> | ||
public ClientException(string message) | ||
: base(message) | ||
{ | ||
this.Error = new ClientError() | ||
{ | ||
Code = HttpStatusCode.InternalServerError.ToString(), | ||
Message = message | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ClientException"/> class. | ||
/// </summary> | ||
/// <param name="message">The corresponding error message.</param> | ||
/// <param name="httpStatus">The Http Status code.</param> | ||
public ClientException(string message, HttpStatusCode httpStatus) | ||
: base(message) | ||
{ | ||
this.HttpStatus = httpStatus; | ||
|
||
this.Error = new ClientError() | ||
{ | ||
Code = this.HttpStatus.ToString(), | ||
Message = message | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ClientException"/> class. | ||
/// </summary> | ||
/// <param name="message">The corresponding error message.</param> | ||
/// <param name="innerException">The inner exception.</param> | ||
public ClientException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
this.Error = new ClientError() | ||
{ | ||
Code = HttpStatusCode.InternalServerError.ToString(), | ||
Message = message | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ClientException"/> class. | ||
/// </summary> | ||
/// <param name="message">The corresponding error message.</param> | ||
/// <param name="errorCode">The error code.</param> | ||
/// <param name="httpStatus">The http status.</param> | ||
/// <param name="innerException">The inner exception.</param> | ||
public ClientException(string message, string errorCode, HttpStatusCode httpStatus, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
this.HttpStatus = httpStatus; | ||
|
||
this.Error = new ClientError() | ||
{ | ||
Code = errorCode, | ||
Message = message | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ClientException"/> class. | ||
/// </summary> | ||
/// <param name="error">The error entity.</param> | ||
/// <param name="httpStatus">The http status.</param> | ||
public ClientException(ClientError error, HttpStatusCode httpStatus) | ||
{ | ||
this.Error = error; | ||
this.HttpStatus = httpStatus; | ||
} | ||
|
||
/// <summary> | ||
/// Gets http status of http response. | ||
/// </summary> | ||
/// <value> | ||
/// The HTTP status. | ||
/// </value> | ||
public HttpStatusCode HttpStatus { get; private set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the httpError message. | ||
/// </summary> | ||
/// <value> | ||
/// The error. | ||
/// </value> | ||
public ClientError Error { get; set; } | ||
|
||
/// <summary> | ||
/// Create Client Exception of Bad Request. | ||
/// </summary> | ||
/// <param name="message">The corresponding error message.</param> | ||
/// <returns>Client Exception Instance.</returns> | ||
public static ClientException BadRequest(string message) | ||
{ | ||
return new ClientException( | ||
new ClientError() | ||
{ | ||
Code = ((int)HttpStatusCode.BadRequest).ToString(), | ||
Message = message | ||
}, | ||
HttpStatusCode.BadRequest); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.ProjectOxford.Common.Contract | ||
{ | ||
/// <summary> | ||
/// Face object returned as part of the FaceDetection/EmotionRecognition operations. | ||
/// </summary> | ||
public class VideoFace | ||
{ | ||
/// <summary> | ||
/// Gets or sets Id of face. | ||
/// </summary> | ||
public int FaceId { get; set; } | ||
} | ||
} |
Oops, something went wrong.