Info
Version: | 3.0.1.25842 |
Author(s): | Sandy Foley, Richard Cabral |
Last Update: | Monday, September 14, 2020 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/verndale/verndale-cognitiveimagetagging |
NuGet Url: | https://www.nuget.org/packages/Verndale.CognitiveImageTagging |
Install
Install-Package Verndale.CognitiveImageTagging
dotnet add package Verndale.CognitiveImageTagging
paket add Verndale.CognitiveImageTagging
Verndale.CognitiveImageTagging Download (Unzip the "nupkg" after downloading)
Dependencies
- Microsoft.Azure.CognitiveServices.Vision.ComputerVision(>= 5.0.0)
- Microsoft.Rest.ClientRuntime(>= 2.3.21)
- Microsoft.Rest.ClientRuntime.Azure(>= 3.3.19)
- Newtonsoft.Json(>= 11.0.2)
Tags
- 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.
REQUIRED
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 are not implemented, but you can see where the extension would occur.
INSTALLATION
Install this package using NuGet.
If used in a plain old .NET application, Configure your app.config file with appropriate AzureServiceConnections.
If used in a web application, your web.config file will point to a config file in /App_Config/.
You need to copy the example config file provided, remove the ".example" extensions and update the settings
with appropriate AzureServiceConnections.
Note that version 2.0 supports multiple, named Azure connections so you can have
different accounts for different server environments as necessary.
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.
USE
To use Image Tagging, get an instance of IImageTagger through Verndale.CognitiveImageTagging.TagManager.GetImageTagger(nameOfConnection)
The ImageTagger has two methods
IImageTagger.GetImageDescription()
IImageTagger.ExtractTextFromImage()
OCR can be performed simultaneously with GetImageDescription via a parameter flag.
Keep in mind you're hitting an external service that not only cost money but
can take some time to complete its evaluation. If you're sending a large batch of images through this utility, expect it to take some time and run up the bill.
Note that OCR tends to be the more expensive operation, both in terms of elapsed time and number of (billed) connections to your AI service.