Image Tagging

Overview

Image Tagging is one of the intelligence services of Filestack platform. You can detect general features of uploaded images both synchronously and through the Workflows.

Processing API

Tagging is available as a synchronous operation in the Processing API using following task:

tags=version:2

To use this task in Processing API, you have to use security policy and signature. Read more about security policies here.

Parameters

version (v) integer (1 - 2) 2

version parameter was added to allow our customers to receive backwards-compatible results as we changed our image tagging backend. version:1 is now considered deprecated.

Response

{
    "tags": {
        "auto": {
            "spherical": 88,
            "wood": 80,
            "finance": 89,
            "business": 98,
            "no person": 98,
            "money": 92,
            "travel": 89,
            "creativity": 79,
            "vacation": 83,
            "strategy": 91,
            "graphic design": 78,
            "facts": 88,
            "paper": 96,
            "text": 85,
            "identity": 78,
            "internet": 87,
            "conceptual": 84,
            "trip (journey)": 81,
            "achievement": 89,
            "retro": 85
        },
        "user": null
    }
}

Response Parameters

tags dictionary Includes all information of tags.
auto dictionary Includes general features with the corresponding confidence numbers.

Examples

  • Get the tags information of your uploaded file:

    https://cdn.filestackcontent.com/security=p:<POLICY>,s:<SIGNATURE>/tags/<HANDLE>
  • Use tags in a chain with other tasks such as resize:

    https://cdn.filestackcontent.com/security=p:<POLICY>,s:<SIGNATURE>/resize=h:2000/tags/<HANDLE>
  • Use tags with an external URL:

    https://cdn.filestackcontent.com/<FILESTACK_API_KEY>/security=p:<POLICY>,s:<SIGNATURE>/tags/<EXTERNAL_URL>
  • Use tags with Storage Aliases:

    https://cdn.filestackcontent.com/<FILESTACK_API_KEY>/security=p:<POLICY>,s:<SIGNATURE>/tags/src://<STORAGE_ALIAS>/<PATH_TO_FILE>

Workflows Task Configuration

If you would like to learn how to use the Workflows UI for configuring tasks (and the logic behind them), visit Creating Workflows Tutorial.

Image Tagging task is available in the Intelligence tasks category.

Workflows Parameters

Task Name string Unique name of the task. It will be included in the webhook response and can be used to build logic below.
Version integer Version of our image tagging backend. Please use version 2 as version 1 is considered deprecated and will be removed soon.

Logic

Image Tagging task returns following response:

{
    "data": {
        "tags": {
            "auto": {
                "feature_1": 98 "an example of confidence number",
                "feature_2": 82
            },
            "user": null
        }
    }
}

Logic Parameters

data dictionary Indicates the response from this service.
tags dictionary Contains "auto" and "user" tags.
auto dictionary Includes all of detected general features from the image with their corresponding confidence numbers.

Based on the task’s response you can build logic that tells the workflow how dependent tasks should be executed. For example, if you would like to run another task if a specific key was detected you can use the following rule:

tags.auto kex "sky"

In Workflows UI this command would look like in the example below:

Visit Creating Workflows Tutorial to learn how you can use Workflows UI to configure your tasks and logic between them.

Webhook

Below is an example webhook payload for an image tagging task. “auto” tags include detected features from the image and their confidence numbers.

{
    "id": 67376965,
    "action": "fs.workflow",
    "timestamp": 1552312203,
    "text": {
        "workflow": "c516519f-3755-4fb5-85a4-15ae4b31d475",
        "createdAt": "2019-03-11T13:49:54.233362645Z",
        "updatedAt": "2019-03-11T13:49:54.825867826Z",
        "sources": [
            "fyR6gNKmQ8OGntKuNnrs"
        ],
        "results": {
            "tags_1552311891723": {
                "data": {
                    "tags": {
                        "auto": {
                            "action": 88,
                            "adult": 95,
                            "battle": 87,
                            "city": 84,
                            "competition": 91,
                            "concert": 88,
                            "crowd": 86,
                            "festival": 95,
                            "fun": 87,
                            "group": 85,
                            "man": 93,
                            "music": 84,
                            "outdoors": 90,
                            "people": 96,
                            "performance": 89,
                            "rain": 96,
                            "street": 85,
                            "umbrella": 97,
                            "wear": 89,
                            "woman": 95
                        },
                        "user": null
                    }
                }
            }
        },
        "status": "Finished"
    }
}

Please visit the webhooks documentation page to learn more.