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

Commit

Permalink
Project Oxford SDK Release - December 2015 Update 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Yung-Shin Lin authored and Yung-Shin Lin committed Dec 15, 2015
1 parent 43d2642 commit 9513031
Show file tree
Hide file tree
Showing 63 changed files with 1,866 additions and 2,682 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions Face/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,6 @@ For questions, feedback, or suggestions about Project Oxford services, feel free

- [Blog](<https://blogs.technet.com/b/machinelearning/archive/tags/project+oxford/default.aspx>)

Changes
============
This document is targeting Project Oxford Face V1.0 service. For user who has experiences on using Project Oxford Face V0, there are some major changes we would like you to know before switching from Project Oxford Face V0 to Project Oxford Face V1.0 service.

- **API Signature**

In Project Oxford Face V1.0, Service root endpoint changes from [https://api.projectoxford.ai/face/v0/]() to [https://api.projectoxford.ai/face/v1.0/]()
There are several signature changes for API, such as [Face - Detect](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), [Face - Identify](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - Find Similar](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237), [Face - Group](https://dev.projectoxford.ai/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395238).

- **Persisted Data**

Existing Person Group and Person data which has been setup with Project Oxford Face V0 cannot be accessed with Project Oxford Face V1.0 service. This incompatible issue will occur for only this one time, following API updates will not affect persisted data any more.

License
=======

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,49 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

namespace Microsoft.ProjectOxford.Face.Contract
using System;

namespace Microsoft.ProjectOxford.Face
{
/// <summary>
/// The face list metadata class.
/// Container of ClientError and Error Entity.
/// </summary>
public class FaceListMetadata
public class ClientError
{
#region Properties

/// <summary>
/// Gets or sets the face list identifier.
/// Gets or sets error code in error entity.
/// </summary>
/// <value>
/// The face list identifier.
/// The code of client error.
/// </value>
public string FaceListId
public string Code
{
get; set;
get;
set;
}

/// <summary>
/// Gets or sets the name.
/// Gets or sets the message.
/// </summary>
/// <value>
/// The name.
/// The message.
/// </value>
public string Name
public string Message
{
get; set;
get;
set;
}

/// <summary>
/// Gets or sets the user data.
/// Gets or sets the request identifier.
/// </summary>
/// <value>
/// The user data.
/// The request identifier.
/// </value>
public string UserData
public Guid RequestId
{
get; set;
get;
set;
}

#endregion Properties
}
}
160 changes: 160 additions & 0 deletions Face/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.
//
// Project Oxford: http://ProjectOxford.ai
//
// ProjectOxford SDK Github:
// https://github.com/Microsoft/ProjectOxfordSDK-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>
/// 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);
}
}
}
18 changes: 3 additions & 15 deletions Face/Windows/ClientLibrary/Contract/Candidate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,20 @@ namespace Microsoft.ProjectOxford.Face.Contract
/// </summary>
public class Candidate
{
#region Properties

/// <summary>
/// Gets or sets the person identifier.
/// </summary>
/// <value>
/// The person identifier.
/// </value>
public Guid PersonId
{
get;
set;
}
public Guid PersonId { get; set; }

/// <summary>
/// Gets or sets the confidence.
/// </summary>
/// <value>
/// The confidence.
/// </value>
public double Confidence
{
get;
set;
}

#endregion Properties
public double Confidence { get; set; }
}
}
}
Loading

0 comments on commit 9513031

Please sign in to comment.