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

Commit

Permalink
Microsoft Cognitive Services SDK Release - March 2016
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectOxford authored and Project Oxford SDK committed Mar 30, 2016
1 parent 20eb322 commit 32db62a
Show file tree
Hide file tree
Showing 1,838 changed files with 67,184 additions and 32,175 deletions.
59 changes: 59 additions & 0 deletions .gitattributes
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
41 changes: 39 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bld/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
#wwwroot/*

# MSTest test Results
[Tt]est[Rr]esult*/
Expand All @@ -51,7 +51,6 @@ artifacts/
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
Expand Down Expand Up @@ -236,3 +235,41 @@ _Pvt_Extensions

.idea/
local.properties

###########################
# iOS
###########################

# OS X
.DS_Store

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa

# Bundler
.bundle

Carthage
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
# Pods/
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Contributing to Project Oxford Client Libraries
Contributing to Microsoft Cognitive Services Client Libraries
===============================================

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

1. Each SDK must include both a client library and a sample showing the API in
Expand Down
79 changes: 79 additions & 0 deletions Common/Windows/ClientLibrary/ClientError.cs
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;
}
}
}
160 changes: 160 additions & 0 deletions Common/Windows/ClientLibrary/ClientException.cs
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);
}
}
}
19 changes: 19 additions & 0 deletions Common/Windows/ClientLibrary/Contract/VideoFace.cs
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; }
}
}
Loading

0 comments on commit 32db62a

Please sign in to comment.