PubNub Integration

Clarifai: Image and Video Recognition

In-app chat

In-app chat

Last Updated:

2016/09/08

Author:

Max Presman

Getting Started GuideClarifai Docs

Analyze, sort, categorize, and tag images or videos

The Clarifai API offers image and video recognition as a service. Whether you have one image or billions, you are only steps away from using artificial intelligence to recognize your visual content. Clarifai's Image and Video Recognition block allows you to analyze and tag images on the fly, while your data is in-motion, meaning that your images are processed before they reach the end user, giving you an efficient and fast way to moderate image heavy realtime web and mobile apps. The block works great for chat, realtime comment services, and collaborative apps.

Walkthrough

Check out our Getting Started Guide with Clarifai, and we'll walk you through building your first image categorization app.

This block queries Clarifai API and adds the image tagging details to the messages.

Input

Publish JSON Object containing image url on input channel. Input Channel: clarifai-channel

{
    "image": "http://www.wallpapersxl.com/wallpapers/1920x1080/soccer-team-mexico/440215/soccer-team-mexico-source-url-http-hqwide-com-sports-football-teams-fenerbahce-440215.jpg"
}

Output

Message containing image tagging data is received on output channel. Output Channel: clarifai-channel-response

{
    "status_code": "OK",
    "status_msg": "All images in request have completed successfully. ",
    "meta": {
        "tag": {
            "timestamp": 1473423927.931051,
            "model": "general-v1.3",
            "config": null
        }
    },
    "results": [
        {
            "docid": 17405917296175250000,
            "url": "http://www.wallpapersxl.com/wallpapers/1920x1080/soccer-team-mexico/440215/soccer-team-mexico-source-url-http-hqwide-com-sports-football-teams-fenerbahce-440215.jpg",
            "status_code": "OK",
            "status_msg": "OK",
            "local_id": "",
            "result": {
                "tag": {
                    "classes": [
                        "soccer",
                        "football",
                        "competition",
                        "match",
                        "stadium",
                        "ball",
                        "game",
                        "web",
                        "athlete",
                        "man",
                        "group",
                        "wear",
                        "uniform",
                        "people",
                        "sports equipment",
                        "outfit",
                        "adult",
                        "sports fan",
                        "goal",
                        "foot"
                    ],
                    "concept_ids": [
                        "ai_fKppxwrj",
                        "ai_mXT38hpL",
                        "ai_7WNVdPhm",
                        "ai_3rjpTxQx",
                        "ai_JbZtzpnP",
                        "ai_v55szW7r",
                        "ai_Trfr4d8h",
                        "ai_fB2qLLwf",
                        "ai_fhqpCCSD",
                        "ai_dxSG2s86",
                        "ai_sd6DKdXp",
                        "ai_86sS08Pw",
                        "ai_prV3z2tW",
                        "ai_l8TKp2h5",
                        "ai_vwd31qqd",
                        "ai_ntt6Zlfl",
                        "ai_VPmHr5bm",
                        "ai_sK0wv7g9",
                        "ai_WZVRxQ9g",
                        "ai_tCxWWQ3t"
                    ],
                    "probs": [
                        0.9976956844329834,
                        0.9852977395057678,
                        0.9837445616722107,
                        0.9833054542541504,
                        0.9743311405181885,
                        0.962491512298584,
                        0.957327663898468,
                        0.9416265487670898,
                        0.9365699291229248,
                        0.9218075275421143,
                        0.9024561047554016,
                        0.8982788324356079,
                        0.8970929980278015,
                        0.8948062062263489,
                        0.8884185552597046,
                        0.8850453495979309,
                        0.8703358769416809,
                        0.8695720434188843,
                        0.8668950796127319,
                        0.8632797002792358
                    ]
                }
            },
            "docid_str": "4cdaa6da173fa2fcf18e3d8f745a7651"
        }
    ]
}

Feedback & Support

Need help? Contact PubNub Support.


Talk to an expert

Contact Sales