POST
/
v1
/
images
/
{image_id}
/
classify
Image Classification
curl --request POST \
  --url https://api.img-processing.com/v1/images/{image_id}/classify \
  --header 'x-api-key: <api-key>'
{
  "main_label": "Tabby",
  "main_score": 0.4316079616546631,
  "secondary_labels": [
    {
      "label": "Tiger Cat",
      "score": 0.37503865361213684
    },
    {
      "label": "Egyptian Cat",
      "score": 0.124073326587677
    },
    {
      "label": "Plastic Bag",
      "score": 0.007065261714160442
    },
    {
      "label": "Lynx",
      "score": 0.003809159155935049
    }
  ]
}

Description

The classify endpoint allows you to classify an image using a pre-trained model. At the moment, the only supported model is the ResNet50 model, a deep learning model that excels at image classification tasks. The endpoint will return a list of labels and their probabilities for the image.
Test images may return accurate results due the test watermarks applied to them. If you want to get better results, please use live images. If you just want to test this feature, contact support to temporarily upgrade your account.

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

image_id
string
required

The unique identifier of the image. This identifier is used to reference the image in subsequent requests.

Response

The API will return the Image object in the response body.

Response object for image identification. Contains the main label and secondary labels with their scores.

main_label
string
required

The main label of the image. This is the label with the highest probability.

main_score
number
required

The probability score of the main label. This is a number between 0 and 1.

secondary_labels
object[]
required

An array of secondary labels with their respective scores. These are the labels with lower probabilities than the main label.