Building a visual features service using the Cognitive Search .NET SDK
The last section was about creating a service that uses an OCR cognitive endpoint to return text within images. In this section, a new service will be created that will return visual features within an image, such as descriptions, tags, and objects.
Using PowerShell
The code in PowerShell is similar to the previous OCR example, so it is not repeated here. The URL is different from the previous code example:
Figure 19.7: Request URL
The request is made using a POST
method, and the URL points to the endpoint in the East US Azure region. It also uses version 2 and consumes the Vision API.
The Cognitive Services access key is part of the HTTP header named ocp-apim-subscription-key
. The header also contains the header content-type with application/json
as the value. This is because the body of the request contains a JSON value. The body has the URL of the image from which text should...