-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Adding Cognitive Services Data Plane Vision+Language SDK #3604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0fd88bf
Adding Vision SDK.
DavidLiCIG 975007a
Add Text Analytics SDK.
DavidLiCIG 6d5299c
Adding Vision
DavidLiCIG fcc2b9c
Removing key.
DavidLiCIG 97895d4
Removing unneeded files
DavidLiCIG b14e4b9
Removing key.
DavidLiCIG 3bd1247
Hooking up Cognitive SDKs with build.
DavidLiCIG ed0da9a
Updating Swagger spec.
DavidLiCIG 251006f
Fix build
DavidLiCIG 3d8b3d4
Moving files around and adding sub namespace for TA.
DavidLiCIG a3f68ec
Merge branch 'psSdkJson6' into psSdkJson6
shahabhijeet 0761253
Merge remote-tracking branch 'azure-sdk-for-net/psSdkJson6' into Offi…
DavidLiCIG 5c220e3
Moving managemenet and dataplane folders into their respective folders.
DavidLiCIG cf8fee6
Updating csproj and files based on comments.
DavidLiCIG 75427ce
Simplifying csprojects
DavidLiCIG f1b0d1f
Merge branch 'psSdkJson6' of https://github.com/DavidLiCIG/azure-sdk-…
DavidLiCIG 9e41f33
Move to temp directory
DavidLiCIG 349f35d
Move back to dataPlane with right casing
DavidLiCIG d394cc1
Move to dataPlane directory
DavidLiCIG a3dc7e9
Fixing presumptive OS specific path convention.
DavidLiCIG e9e182b
Adding Assembly.Info for Language
DavidLiCIG 529c38d
Adding AssemblyInfo for VIsion
DavidLiCIG 58508d0
Updates based on feedback.
DavidLiCIG 8ab7c50
Adding a simple readme.md.
DavidLiCIG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/SDKs/CognitiveServices/data-plane/Microsoft.CognitiveServices.Vision.Tests/BaseTests.cs
This file contains hidden or 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,34 @@ | ||
| using Microsoft.CognitiveServices.Vision.Face; | ||
| using Microsoft.Extensions.Configuration; | ||
|
|
||
| namespace FaceSDK.Tests | ||
| { | ||
| public abstract class BaseTests | ||
| { | ||
| private static string SubscriptionKey = null; | ||
| private static string Region = null; | ||
|
|
||
| static BaseTests() | ||
| { | ||
| var builder = new ConfigurationBuilder() | ||
| .AddJsonFile("testsettings.json"); | ||
|
|
||
| // Create the configuration object that the application will | ||
| // use to retrieve configuration information. | ||
| var configuration = builder.Build(); | ||
|
|
||
| // Retrieve the configuration information. | ||
| SubscriptionKey = configuration["SubscriptionKey"]; | ||
| Region = configuration["Region"]; | ||
| } | ||
|
|
||
| protected FaceAPI GetClient() | ||
| { | ||
| return new FaceAPI() | ||
| { | ||
| SubscriptionKey = SubscriptionKey, | ||
| AzureRegion1 = Region | ||
| }; | ||
| } | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
...gnitiveServices/data-plane/Microsoft.CognitiveServices.Vision.Tests/FaceDetectionTests.cs
This file contains hidden or 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,23 @@ | ||
| using Microsoft.CognitiveServices.Vision.Face; | ||
| using Microsoft.CognitiveServices.Vision.Face.Models; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using Xunit; | ||
|
|
||
| namespace FaceSDK.Tests | ||
| { | ||
| public class FaceDetectionTests : BaseTests | ||
| { | ||
| [Fact] | ||
| public void FaceDetection() | ||
| { | ||
| FaceAPI client = GetClient(); | ||
| using (FileStream stream = new FileStream("TestImages\\detection1.jpg", FileMode.Open)) | ||
| { | ||
| IList<DetectedFace> faceList = client.Face.DetectInStream(stream); | ||
| Assert.Equal(1, faceList.Count); | ||
| } | ||
| } | ||
| } | ||
| } |
43 changes: 43 additions & 0 deletions
43
.../Microsoft.CognitiveServices.Vision.Tests/Microsoft.CognitiveServices.Vision.Tests.csproj
This file contains hidden or 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,43 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp1.1</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Remove="testsettings.json" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Content Include="testsettings.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </Content> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Extensions.Configuration" Version="1.1.2" /> | ||
| <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.2" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> | ||
| <PackageReference Include="xunit" Version="2.3.0-beta3-build3705" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" /> | ||
| <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta3-build3705" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Microsoft.CognitiveServices.Vision\Microsoft.CognitiveServices.Vision.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Update="TestImages\detection1.jpg"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="testsettings.json"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </None> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
Binary file added
BIN
+357 KB
...s/data-plane/Microsoft.CognitiveServices.Vision.Tests/TestImages/detection1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
...s/CognitiveServices/data-plane/Microsoft.CognitiveServices.Vision.Tests/testsettings.json
This file contains hidden or 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,4 @@ | ||
| { | ||
| "subscriptionKey": "{PUT_YOUR_KEY_HERE}", | ||
| "region": "WestCentralUS" | ||
| } |
28 changes: 28 additions & 0 deletions
28
src/SDKs/CognitiveServices/data-plane/Microsoft.CognitiveServices.Vision.sln
This file contains hidden or 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,28 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio 15 | ||
| VisualStudioVersion = 15.0.26430.16 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CognitiveServices.Vision", "Microsoft.CognitiveServices.Vision\Microsoft.CognitiveServices.Vision.csproj", "{6807B854-8528-4FEE-A25D-C43C3AA2D601}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CognitiveServices.Vision.Tests", "Microsoft.CognitiveServices.Vision.Tests\Microsoft.CognitiveServices.Vision.Tests.csproj", "{5987D97A-E532-450C-BF22-A1F595C927F1}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {6807B854-8528-4FEE-A25D-C43C3AA2D601}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {6807B854-8528-4FEE-A25D-C43C3AA2D601}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {6807B854-8528-4FEE-A25D-C43C3AA2D601}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {6807B854-8528-4FEE-A25D-C43C3AA2D601}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {5987D97A-E532-450C-BF22-A1F595C927F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {5987D97A-E532-450C-BF22-A1F595C927F1}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {5987D97A-E532-450C-BF22-A1F595C927F1}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {5987D97A-E532-450C-BF22-A1F595C927F1}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| EndGlobal |
137 changes: 137 additions & 0 deletions
137
...CognitiveServices/data-plane/Microsoft.CognitiveServices.Vision/Generated/Face/FaceAPI.cs
This file contains hidden or 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,137 @@ | ||
| // Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0 | ||
| // Changes may cause incorrect behavior and will be lost if the code is | ||
| // regenerated. | ||
|
|
||
| namespace Microsoft.CognitiveServices.Vision.Face | ||
| { | ||
| using Microsoft.CognitiveServices; | ||
| using Microsoft.CognitiveServices.Vision; | ||
| using Microsoft.Rest; | ||
| using Microsoft.Rest.Serialization; | ||
| using Models; | ||
| using Newtonsoft.Json; | ||
| using System.Collections; | ||
| using System.Collections.Generic; | ||
| using System.Net; | ||
| using System.Net.Http; | ||
|
|
||
| /// <summary> | ||
| /// An API for face detection, verification, and identification. | ||
| /// </summary> | ||
| public partial class FaceAPI : ServiceClient<FaceAPI>, IFaceAPI | ||
| { | ||
| /// <summary> | ||
| /// The base URI of the service. | ||
| /// </summary> | ||
| internal string BaseUri {get; set;} | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets json serialization settings. | ||
| /// </summary> | ||
| public JsonSerializerSettings SerializationSettings { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets json deserialization settings. | ||
| /// </summary> | ||
| public JsonSerializerSettings DeserializationSettings { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Supported Azure regions for Face Detection endpoints. Possible values | ||
| /// include: 'westus', 'westeurope', 'southeastasia', 'eastus2', | ||
| /// 'westcentralus' | ||
| /// </summary> | ||
| public string AzureRegion1 { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Subscription key in header | ||
| /// </summary> | ||
| public string SubscriptionKey { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the IFaceOperations. | ||
| /// </summary> | ||
| public virtual IFaceOperations Face { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the IPerson. | ||
| /// </summary> | ||
| public virtual IPerson Person { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the IPersonGroup. | ||
| /// </summary> | ||
| public virtual IPersonGroup PersonGroup { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the IFaceList. | ||
| /// </summary> | ||
| public virtual IFaceList FaceList { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the FaceAPI class. | ||
| /// </summary> | ||
| /// <param name='handlers'> | ||
| /// Optional. The delegating handlers to add to the http client pipeline. | ||
| /// </param> | ||
| public FaceAPI(params DelegatingHandler[] handlers) : base(handlers) | ||
| { | ||
| Initialize(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the FaceAPI class. | ||
| /// </summary> | ||
| /// <param name='rootHandler'> | ||
| /// Optional. The http client handler used to handle http transport. | ||
| /// </param> | ||
| /// <param name='handlers'> | ||
| /// Optional. The delegating handlers to add to the http client pipeline. | ||
| /// </param> | ||
| public FaceAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) | ||
| { | ||
| Initialize(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// An optional partial-method to perform custom initialization. | ||
| ///</summary> | ||
| partial void CustomInitialize(); | ||
| /// <summary> | ||
| /// Initializes client properties. | ||
| /// </summary> | ||
| private void Initialize() | ||
| { | ||
| Face = new FaceOperations(this); | ||
| Person = new Person(this); | ||
| PersonGroup = new PersonGroup(this); | ||
| FaceList = new FaceList(this); | ||
| BaseUri = "https://{azureRegion}.api.cognitive.microsoft.com/face/v1.0"; | ||
| SerializationSettings = new JsonSerializerSettings | ||
| { | ||
| Formatting = Newtonsoft.Json.Formatting.Indented, | ||
| DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, | ||
| DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, | ||
| NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, | ||
| ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, | ||
| ContractResolver = new ReadOnlyJsonContractResolver(), | ||
| Converters = new List<JsonConverter> | ||
| { | ||
| new Iso8601TimeSpanConverter() | ||
| } | ||
| }; | ||
| DeserializationSettings = new JsonSerializerSettings | ||
| { | ||
| DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, | ||
| DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, | ||
| NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, | ||
| ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, | ||
| ContractResolver = new ReadOnlyJsonContractResolver(), | ||
| Converters = new List<JsonConverter> | ||
| { | ||
| new Iso8601TimeSpanConverter() | ||
| } | ||
| }; | ||
| CustomInitialize(); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidLiCIG can you model your test project by looking at other tests.