Giter VIP home page Giter VIP logo

cognitive-vision-windows's Introduction

Microsoft Computer Vision API: Windows Client Library & Sample

❗❗❗

The Vision Client Library is here for archival purpose only. .NET users are asked to switch to the newer Microsoft.Azure.CognitiveServices.Vision.ComputerVision package, the source for which can be found here.

For users interested in client libraries for other languages/platforms, quickstarts, etc., please see the official documentation page.

❗❗❗

This repo contains the Windows client library & sample for the Microsoft Computer Vision API, an offering within Microsoft Cognitive Services, formerly known as Project Oxford.

The Client Library

The client library is a thin C# client wrapper for the Computer Vision API.

The easiest way to use this client library is to get microsoft.projectoxford.vision package from nuget. Go to Vision API Package in nuget for more details.

The Sample

This sample is a Windows WPF application to demonstrate the use of the Computer Vision API.

Build the sample

  1. Starting in the folder where you clone the repository (this folder)

  2. In a git command line tool, type git submodule init (or do this through a UI)

  3. Pull in the shared Windows code by calling git submodule update

  4. Start Microsoft Visual Studio 2015 and select File > Open > Project/Solution.

  5. Starting in the folder where you clone the repository, go to Vision > Windows > Sample-WPF Folder.

  6. Double-click the Visual Studio 2015 Solution (.sln) file VisionAPI-WPF-Samples.

  7. Press Ctrl+Shift+B, or select Build > Build Solution.

Run the sample

After the build is complete, press F5 to run the sample.

First, you must obtain a Vision API subscription key by following the instructions on our website.

Locate the text edit box saying "Paste your subscription key here to start" on the top right corner. Paste your subscription key. You can choose to persist your subscription key in your machine by clicking "Save Key" button. When you want to delete the subscription key from the machine, click "Delete Key" to remove it from your machine.

Microsoft will receive the images you upload and may use them to improve the Computer Vision API and related services. By submitting an image, you confirm you have consent from everyone in it.

Contributing

We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see LICENSE.

Sample images are licensed separately, please refer to LICENSE-IMAGE.

Developer Code of Conduct

Developers using Cognitive Services, including this client library & sample, are expected to follow the “Developer Code of Conduct for Microsoft Cognitive Services”, found at http://go.microsoft.com/fwlink/?LinkId=698895.

cognitive-vision-windows's People

Contributors

chsienki avatar cthrash avatar delfu avatar johnbindel avatar lightfrenzy avatar microsoft-github-policy-service[bot] avatar mike-int avatar msftgits avatar nitinme avatar sinkee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cognitive-vision-windows's Issues

SampleUserControlLibrary doesn't exist

Hi
in order to load the VisionAPI-WPF-Samples.sln visual studio tries to load SampleUserControlLibrary.sln as a dependency which is not exit in project file there for the project cant build.

The WPF sample is missing the Control library

It looks like WPF sample build fails. The Client UI library needed to build the sample is not part of the repo. The library needs to be added as part of the repo for the WPF sample to build.

See also,
#15

Analyze image with domain model throws exception

When Analyzing the image with domain model, exception is thrown below.

[13:30:02.583716]: VisionServiceClient is created
[13:30:02.590211]: Calling VisionServiceClient.AnalyzeImageInDomainAsync()...
[13:30:12.467021]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__42_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__422.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at VisionAPI_WPF_Samples.AnalyzeInDomainPage.<UploadAndAnalyzeInDomainImage>d__2.MoveNext() in C:\Users\samanoh\git\Cognitive-Vision-Windows\Sample-WPF\AnalyzeInDomainPage.xaml.cs:line 115 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at VisionAPI_WPF_Samples.AnalyzeInDomainPage.d__4.MoveNext() in C:\Users\samanoh\git\Cognitive-Vision-Windows\Sample-WPF\AnalyzeInDomainPage.xaml.cs:line 166
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__15.MoveNext() in C:\Users\samanoh\git\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 90

Fail to build in VS 2015.

I opened the solution VisionAPI-WPF-Samples, but the build failed:

1>------ Build started: Project: SampleUserControlLibrary, Configuration: Debug Any CPU ------
1>C:\home\Study\Microsoft\Cognitive-Vision-Windows\Cognitive-Common-Windows\SampleUserControlLibrary\SampleUserControl.xaml(8,43,8,58): error CS0234: The type or namespace name 'SampleScenarios' does not exist in the namespace 'SampleUserControlLibrary.SampleUserControlLibrary' (are you missing an assembly reference?)
2>------ Build started: Project: VisionAPI-WPF-Samples, Configuration: Debug Any CPU ------
2>C:\home\Study\Microsoft\Cognitive-Vision-Windows\Sample-WPF\MainWindow.xaml(12,10): error MC3074: The tag 'SampleScenarios' does not exist in XML namespace 'clr-namespace:SampleUserControlLibrary;assembly=SampleUserControlLibrary'. Line 12 Position 10.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Computer Vision API (Analyze an image) not giving proper responses for machinery

I have a requirement to identify machinery image like (Lathe, Miller, Shaping etc.). But Analyze Image API (https://api.projectoxford.ai/vision/v1.0/analyze) is not providing correct machinery name. Attached is the image of a Lathe Machine but it is providing [ { "name": "sky", "confidence": 0.985724687576294 }, { "name": "projector", "confidence": 0.1976199895143509 } ]
analyzeimagelathemachine

Also another image of "Shaping Machine" but Analyzer is providing "Miller" Machine. PFA
analyzeshapingimage

Is there any way to correct an incorrect tagged image?

FAILED to run the vision c# example

From @khadijah111 on June 10, 2016 21:39

hello every body..

i followed the steps written here

https://www.microsoft.com/cognitive-services/en-us/computer-vision-api/documentation/getstarted/getstartedvisionapiforwindows

i downloaded the codes zip from gethups

1- the folder Sample-console not found

2- i tryied the examole inside SAMPLE.WPF and when tring to start the c# project, alot of errors generated like this:

Error CS0234
The type or namespace name 'ProjectOxford' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
VisionAPI-WPF-Samples C:\Users\khadijah\Documents\Visual Studio 2015\ProjectOxford-ClientSDK-CognitiveServices_1606\Vision\Windows\Sample-WPF\AnalyzeInDomainPage.xaml.cs
43 Active

do you have any idea please ..

thanks in advanced.

Copied from original issue: microsoft/ProjectOxford-ClientSDK#73

WPF sample builds and runs but throws exception on Analyze

Here is what gets dumped in the console:
[16:11:51.353827]: VisionServiceClient is created
[16:11:51.355825]: Calling VisionServiceClient.AnalyzeImageAsync()...
[16:11:53.596602]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__42_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__422.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.d__211.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__1.MoveNext() in C:\Demos\Cortana\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 86
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__3.MoveNext() in C:\Demos\Cortana\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 141
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__15.MoveNext() in C:\Demos\Cortana\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 90

sample WPF won't build

Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'SampleUserControlLibrary' could not be found (are you missing a using directive or an assembly reference?) VisionAPI-WPF-Samples C:\Users\antho\Cognitive-Vision-Windows\Sample-WPF\MainWindow.xaml.cs 35 Active

Text extraction doesn't work for white writing on over a photo, but does if you invert the colors and resubmit.

I'm not 100% sure I'm in the right place to report this, but: I'm testing the Demo handwriting recognition ( https://azure.microsoft.com/en-ca/services/cognitive-services/computer-vision/#handwriting ) on some vintage postcards.

I've found that I can submit an image and get no results, or nonsense results back. But if I submit the negative version of the exact same image then the results are perfect.

Original image: https://1drv.ms/u/s!As3ZytCDCPbLkIJdz5P2TCj7nRijHA
Color inverted image: https://1drv.ms/u/s!As3ZytCDCPbLkIJcytVrtB0OrmDHTg

(In this case, the text is typed but I've been using the handwriting demo because they are often hand printed.)

I thought this might provide an avenue for improvement, i.e., if the service also processed the negative of the submission and compared confidences.

How to retrieve landmarks

On the page https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision, there is a section telling that Vision API is able to recognize landmarks, and an example regarding Colosseum is provided:
colosseum

However, if I try to call the Vision API using an URL like the following one, with the same image in the body:

POST https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/analyze?visualFeatures=Categories&language=en&subscription-key=<my_subscription_key>

I obtain this:

fiddler

So, the categories are the same, but with no detail. Am I missing something in order to retrieve landmarks information?

Generic exception thrown when keys have expired

From @SaqibS on December 19, 2015 16:54

I have an Azure service which makes use of multiple Project Oxford APIs, and overnight calls to each of the services started failing.

I looked through the logs, and found that the client libraries for both Vision and Face were throwing a System.Exception, with message: "Transport error".

Eventually, I found that invoking the APIs using rest directly, I got a useful message back, saying that the keys had expired. Why this happened is a separate issue, along with why I didn't get any emails to say that the keys were going to expire (they still show as active on the website). But that's all separate - this bug relates to the fact that the client libraries shouldn't just throw a generic Exception with such a vague message. The message returned by the rest API should be wrapped in the client-specific exception.

Copied from original issue: microsoft/ProjectOxford-ClientSDK#13

WPF Sample app doesn't build

Since #14 the sample app is failing to build.

This is temporary and will be fixed as soon as the newest NuGet package is published

The WPF app raises a ClientException

[10:57:13.233378]: VisionServiceClient is created
[10:57:13.267888]: Calling VisionServiceClient.AnalyzeImageAsync()...
[10:57:16.562135]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__39_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__392.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.d__211.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__1.MoveNext() in C:\Users\smerc\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 86
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__3.MoveNext() in C:\Users\smerc\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 141
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__13.MoveNext() in C:\Users\smerc\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 88

Analyze Image is not working

I get the following error when I Analyze the image

[14:13:52.548178]: VisionServiceClient is created
[14:13:52.559227]: Calling VisionServiceClient.AnalyzeImageAsync()...
[14:13:53.429685]: Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.b__42_1[TRequest,TResponse](Exception e)
at System.AggregateException.Handle(Func2 predicate) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__422.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ProjectOxford.Vision.VisionServiceClient.d__211.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at Microsoft.ProjectOxford.Vision.VisionServiceClient.<AnalyzeImageAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__2.MoveNext() in C:\projects\Research\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 117
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at VisionAPI_WPF_Samples.AnalyzePage.d__3.MoveNext() in C:\projects\Research\Cognitive-Vision-Windows\Sample-WPF\AnalyzePage.xaml.cs:line 145
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at VisionAPI_WPF_Samples.ImageScenarioPage.d__15.MoveNext() in C:\projects\Research\Cognitive-Vision-Windows\Sample-WPF\ImageScenarioPage.cs:line 90

Screen Shot
https://prnt.sc/gog863

No changes made to the code or anything, the default is throwing an exception.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.