This library features three functions:
- Using AI, "read" the image and provide a sentence description of what it portrays.
- Using AI, "read" the image and provide series of tags that describe what it portrays.
- Using AI, perform OCR on the image and, if the image has embedded text, extract the text to a string value.
The first two features are included in the IAnalysisService.GetImageDescription() call.
OCR can be performed by opting it into the GetImageDescription() call or by calling the IAnalysisService.ExtractTextFromImage() call.
Note that OCR tends to be a more expensive operation both in terms of elapsed time and number of connections to your AI service. Some charges may be incurred.
You must have a subscription to Azure Cognitive Services for Computer Vision. You will need both a Subscription Key and an endpoint URL to use this library. Support for other AI
services is planned.
Installation and Use
Install this package using NuGet.
You can get an instance of IAnalysisService through Verndale.CognitiveImageTagging.ServiceManager.GetAnalysisService()
Alternately, you can use Dependency Injection. specify that IAnalysisService maps to Verndale.CognitiveImageTagging.Services.AzureService
You must add configuration to your app.config or web.config file. See the enclosed app.config.example for details.
In the supplied config example, you will see confidence levels for captions and embedded text. These are set to reasonable defaults, but be aware the AI can be
quirky and unreliable. This tool should be used prime the pump on image descriptions but should not be used unsupervised.
Install-Package Verndale.CognitiveImageTagging -Version 126.96.36.19989
dotnet add package Verndale.CognitiveImageTagging --version 188.8.131.5289
<PackageReference Include="Verndale.CognitiveImageTagging" Version="184.108.40.20689" />
paket add Verndale.CognitiveImageTagging --version 220.127.116.1189
- Microsoft.Azure.CognitiveServices.Vision.ComputerVision (>= 5.0.0)
- Microsoft.Rest.ClientRuntime (>= 2.3.18)
This package is not used by any popular GitHub repositories.