Computer Vision API – Describe Image

The “Describe” operation provides meaningful description about the uploaded image. More than one description can be generated by the operation and it can be managed through parameter. Along with the description the API also provide tags related to the image. The descriptions are ordered by confident scores.

API referencehttps://bit.ly/2mfVlim

Pre-requisites

  • Computer Vision service or Cognitive Services provisioned on Azure
  • Postman App

Image Requirements

  • Supported image formats: JPEG, PNG, GIF, BMP.
  • Image file size must be less than 4MB.
  • Image dimensions must be between 50 x 50 and 4200 x 4200 pixels, and the image cannot be larger than 10 megapixels.

Describe Image Operation

  • Launch Postman
  • Append your endpoint URL from pre-requisites step with /vision/2.0/describe and provide the query parameters as shown below.

  • Provide the subscription key and content-type in Headers tab

  • Provide the image URL in the Body tab.

  • Following image is provided in the blob URL

  • Click ‘Send’ and you will get the output as json.
{
     "description": {
         "tags": [
             "person",
             "player",
             "man",
             "holding",
             "baseball",
             "ball",
             "hand",
             "game",
             "uniform",
             "wearing",
             "bat",
             "blue",
             "field",
             "throwing",
             "standing",
             "young",
             "air",
             "playing",
             "pitch",
             "pitcher",
             "doing"
         ],
         "captions": [
             {
                 "text": "Sachin Tendulkar in a blue uniform holding a baseball bat",
                 "confidence": 0.46406672073844357
             },
             {
                 "text": "Sachin Tendulkar wearing a blue uniform holding a baseball bat",
                 "confidence": 0.41645714309971438
             },
             {
                 "text": "Sachin Tendulkar holding a baseball bat",
                 "confidence": 0.35723763139571235
             },
             {
                 "text": "Sachin Tendulkar in a blue uniform holding a baseball bat in his hand",
                 "confidence": 0.35623763139571235
             },
             {
                 "text": "Sachin Tendulkar in a blue uniform holding a bat",
                 "confidence": 0.35523763139571235
             }
         ]
     },
     "requestId": "d2a342db-2422-4ed5-9e6a-85e0d18785ed",
     "metadata": {
         "width": 674,
         "height": 500,
         "format": "Jpeg"
     }
 }
  • The result provides 5 description and tags associated with the image.

Leave a Reply

Your email address will not be published. Required fields are marked *