Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 32db62a

Browse files
ProjectOxfordProject Oxford SDK
authored andcommitted
Microsoft Cognitive Services SDK Release - March 2016
1 parent 20eb322 commit 32db62a

File tree

1,838 files changed

+67184
-32175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,838 files changed

+67184
-32175
lines changed

.gitattributes

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
###############################################################################
6+
# Set default behavior for command prompt diff.
7+
#
8+
# This is need for earlier builds of msysgit that does not have it on by
9+
# default for csharp files.
10+
# Note: This is only used by command line
11+
###############################################################################
12+
#*.cs diff=csharp
13+
###############################################################################
14+
# Set the merge driver for project and solution files
15+
#
16+
# Merging from the command prompt will add diff markers to the files if there
17+
# are conflicts (Merging from VS is not affected by the settings below, in VS
18+
# the diff markers are never inserted). Diff markers may cause the following
19+
# file extensions to fail to load in VS. An alternative would be to treat
20+
# these files as binary and thus will always conflict and require user
21+
# intervention with every merge. To do so, just uncomment the entries below
22+
###############################################################################
23+
#*.sln merge=binary
24+
#*.csproj merge=binary
25+
#*.vbproj merge=binary
26+
#*.vcxproj merge=binary
27+
#*.vcproj merge=binary
28+
#*.dbproj merge=binary
29+
#*.fsproj merge=binary
30+
#*.lsproj merge=binary
31+
#*.wixproj merge=binary
32+
#*.modelproj merge=binary
33+
#*.sqlproj merge=binary
34+
#*.wwaproj merge=binary
35+
###############################################################################
36+
# behavior for image files
37+
#
38+
# image files are treated as binary by default.
39+
###############################################################################
40+
#*.jpg binary
41+
#*.png binary
42+
#*.gif binary
43+
###############################################################################
44+
# diff behavior for common document formats
45+
#
46+
# Convert binary document formats to text before diffing them. This feature
47+
# is only available from the command line. Turn it on by uncommenting the
48+
# entries below.
49+
###############################################################################
50+
#*.doc diff=astextplain
51+
#*.DOC diff=astextplain
52+
#*.docx diff=astextplain
53+
#*.DOCX diff=astextplain
54+
#*.dot diff=astextplain
55+
#*.DOT diff=astextplain
56+
#*.pdf diff=astextplain
57+
#*.PDF diff=astextplain
58+
#*.rtf diff=astextplain
59+
#*.RTF diff=astextplain

.gitignore

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bld/
2626
# Visual Studio 2015 cache/options directory
2727
.vs/
2828
# Uncomment if you have tasks that create the project's static files in wwwroot
29-
#wwwroot/
29+
#wwwroot/*
3030

3131
# MSTest test Results
3232
[Tt]est[Rr]esult*/
@@ -51,7 +51,6 @@ artifacts/
5151
*.ilk
5252
*.meta
5353
*.obj
54-
*.pch
5554
*.pdb
5655
*.pgc
5756
*.pgd
@@ -236,3 +235,41 @@ _Pvt_Extensions
236235

237236
.idea/
238237
local.properties
238+
239+
###########################
240+
# iOS
241+
###########################
242+
243+
# OS X
244+
.DS_Store
245+
246+
# Xcode
247+
build/
248+
*.pbxuser
249+
!default.pbxuser
250+
*.mode1v3
251+
!default.mode1v3
252+
*.mode2v3
253+
!default.mode2v3
254+
*.perspectivev3
255+
!default.perspectivev3
256+
xcuserdata
257+
*.xccheckout
258+
profile
259+
*.moved-aside
260+
DerivedData
261+
*.hmap
262+
*.ipa
263+
264+
# Bundler
265+
.bundle
266+
267+
Carthage
268+
# We recommend against adding the Pods directory to your .gitignore. However
269+
# you should judge for yourself, the pros and cons are mentioned at:
270+
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
271+
#
272+
# Note: if you ignore the Pods directory, make sure to uncomment
273+
# `pod install` in .travis.yml
274+
#
275+
# Pods/

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Contributing to Project Oxford Client Libraries
1+
Contributing to Microsoft Cognitive Services Client Libraries
22
===============================================
33

4-
So, you want to contribute on a client SDK for one of the Project Oxford APIs.
4+
So, you want to contribute on a client SDK for one of the Microsoft Cognitive Services.
55
Here's what you need to know.
66

77
1. Each SDK must include both a client library and a sample showing the API in
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license.
4+
//
5+
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
6+
//
7+
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
8+
// https://github.com/Microsoft/ProjectOxford-ClientSDK
9+
//
10+
// Copyright (c) Microsoft Corporation
11+
// All rights reserved.
12+
//
13+
// MIT License:
14+
// Permission is hereby granted, free of charge, to any person obtaining
15+
// a copy of this software and associated documentation files (the
16+
// "Software"), to deal in the Software without restriction, including
17+
// without limitation the rights to use, copy, modify, merge, publish,
18+
// distribute, sublicense, and/or sell copies of the Software, and to
19+
// permit persons to whom the Software is furnished to do so, subject to
20+
// the following conditions:
21+
//
22+
// The above copyright notice and this permission notice shall be
23+
// included in all copies or substantial portions of the Software.
24+
//
25+
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
26+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29+
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32+
//
33+
34+
using System;
35+
36+
namespace Microsoft.ProjectOxford.Common
37+
{
38+
/// <summary>
39+
/// Container of ClientError and Error Entity.
40+
/// </summary>
41+
public class ClientError
42+
{
43+
/// <summary>
44+
/// Gets or sets error code in error entity.
45+
/// </summary>
46+
/// <value>
47+
/// The code of client error.
48+
/// </value>
49+
public string Code
50+
{
51+
get;
52+
set;
53+
}
54+
55+
/// <summary>
56+
/// Gets or sets the message.
57+
/// </summary>
58+
/// <value>
59+
/// The message.
60+
/// </value>
61+
public string Message
62+
{
63+
get;
64+
set;
65+
}
66+
67+
/// <summary>
68+
/// Gets or sets the request identifier.
69+
/// </summary>
70+
/// <value>
71+
/// The request identifier.
72+
/// </value>
73+
public Guid RequestId
74+
{
75+
get;
76+
set;
77+
}
78+
}
79+
}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license.
4+
//
5+
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
6+
//
7+
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
8+
// https://github.com/Microsoft/ProjectOxford-ClientSDK
9+
//
10+
// Copyright (c) Microsoft Corporation
11+
// All rights reserved.
12+
//
13+
// MIT License:
14+
// Permission is hereby granted, free of charge, to any person obtaining
15+
// a copy of this software and associated documentation files (the
16+
// "Software"), to deal in the Software without restriction, including
17+
// without limitation the rights to use, copy, modify, merge, publish,
18+
// distribute, sublicense, and/or sell copies of the Software, and to
19+
// permit persons to whom the Software is furnished to do so, subject to
20+
// the following conditions:
21+
//
22+
// The above copyright notice and this permission notice shall be
23+
// included in all copies or substantial portions of the Software.
24+
//
25+
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
26+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29+
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32+
//
33+
34+
using System;
35+
using System.Net;
36+
37+
namespace Microsoft.ProjectOxford.Common
38+
{
39+
/// <summary>
40+
/// The Exception will be shown to client.
41+
/// </summary>
42+
public class ClientException : Exception
43+
{
44+
/// <summary>
45+
/// Initializes a new instance of the <see cref="ClientException"/> class.
46+
/// </summary>
47+
public ClientException()
48+
: base()
49+
{
50+
}
51+
52+
/// <summary>
53+
/// Initializes a new instance of the <see cref="ClientException"/> class.
54+
/// </summary>
55+
/// <param name="message">The corresponding error message.</param>
56+
public ClientException(string message)
57+
: base(message)
58+
{
59+
this.Error = new ClientError()
60+
{
61+
Code = HttpStatusCode.InternalServerError.ToString(),
62+
Message = message
63+
};
64+
}
65+
66+
/// <summary>
67+
/// Initializes a new instance of the <see cref="ClientException"/> class.
68+
/// </summary>
69+
/// <param name="message">The corresponding error message.</param>
70+
/// <param name="httpStatus">The Http Status code.</param>
71+
public ClientException(string message, HttpStatusCode httpStatus)
72+
: base(message)
73+
{
74+
this.HttpStatus = httpStatus;
75+
76+
this.Error = new ClientError()
77+
{
78+
Code = this.HttpStatus.ToString(),
79+
Message = message
80+
};
81+
}
82+
83+
/// <summary>
84+
/// Initializes a new instance of the <see cref="ClientException"/> class.
85+
/// </summary>
86+
/// <param name="message">The corresponding error message.</param>
87+
/// <param name="innerException">The inner exception.</param>
88+
public ClientException(string message, Exception innerException)
89+
: base(message, innerException)
90+
{
91+
this.Error = new ClientError()
92+
{
93+
Code = HttpStatusCode.InternalServerError.ToString(),
94+
Message = message
95+
};
96+
}
97+
98+
/// <summary>
99+
/// Initializes a new instance of the <see cref="ClientException"/> class.
100+
/// </summary>
101+
/// <param name="message">The corresponding error message.</param>
102+
/// <param name="errorCode">The error code.</param>
103+
/// <param name="httpStatus">The http status.</param>
104+
/// <param name="innerException">The inner exception.</param>
105+
public ClientException(string message, string errorCode, HttpStatusCode httpStatus, Exception innerException)
106+
: base(message, innerException)
107+
{
108+
this.HttpStatus = httpStatus;
109+
110+
this.Error = new ClientError()
111+
{
112+
Code = errorCode,
113+
Message = message
114+
};
115+
}
116+
117+
/// <summary>
118+
/// Initializes a new instance of the <see cref="ClientException"/> class.
119+
/// </summary>
120+
/// <param name="error">The error entity.</param>
121+
/// <param name="httpStatus">The http status.</param>
122+
public ClientException(ClientError error, HttpStatusCode httpStatus)
123+
{
124+
this.Error = error;
125+
this.HttpStatus = httpStatus;
126+
}
127+
128+
/// <summary>
129+
/// Gets http status of http response.
130+
/// </summary>
131+
/// <value>
132+
/// The HTTP status.
133+
/// </value>
134+
public HttpStatusCode HttpStatus { get; private set; }
135+
136+
/// <summary>
137+
/// Gets or sets the httpError message.
138+
/// </summary>
139+
/// <value>
140+
/// The error.
141+
/// </value>
142+
public ClientError Error { get; set; }
143+
144+
/// <summary>
145+
/// Create Client Exception of Bad Request.
146+
/// </summary>
147+
/// <param name="message">The corresponding error message.</param>
148+
/// <returns>Client Exception Instance.</returns>
149+
public static ClientException BadRequest(string message)
150+
{
151+
return new ClientException(
152+
new ClientError()
153+
{
154+
Code = ((int)HttpStatusCode.BadRequest).ToString(),
155+
Message = message
156+
},
157+
HttpStatusCode.BadRequest);
158+
}
159+
}
160+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Microsoft.ProjectOxford.Common.Contract
8+
{
9+
/// <summary>
10+
/// Face object returned as part of the FaceDetection/EmotionRecognition operations.
11+
/// </summary>
12+
public class VideoFace
13+
{
14+
/// <summary>
15+
/// Gets or sets Id of face.
16+
/// </summary>
17+
public int FaceId { get; set; }
18+
}
19+
}

0 commit comments

Comments
 (0)