GET count_metadata

Given an entire image collection or given a subset of the collection filtered using metadata and/or a list of colours and/or a list of collection images, and given a list of metadata queries, generate a counter for each query specifying how many of the collection images meet that query.

Resource URL

https://multicolorengine.tineye.com/<company>/rest/count_metadata/

Parameters

In addition to the Common parameters there are:

Collection

Key

Description

count_metadata[0]

A metadata query which you want to count.

count_metadata[n] (optional)

A metadata query which you want to count.

Metadata

Key

Description

metadata

The metadata query to be used for image filtering.

count_metadata[0]

A metadata query which you want to count.

count_metadata[n] (optional)

A metadata query which you want to count.

min_score (optional)

Minimum score to filter the queries by.

Colors

Key

Description

colors[0]

A color to be used for image filtering. Can be entered as either RGB format (255,255,255) or hex format (ffffff).

colors[n] (optional)

A color to be used for image filtering.

weights[0] (optional, but required for all colors if specified)

A weight for the first color, should be between 1 and 100 and all weights should add up to 100.

weights[n] (optional)

A weight for the nth color.

count_metadata[0]

A metadata query which you want to count.

count_metadata[n] (optional)

A metadata query which you want to count.

min_score (optional)

Minimum score to filter the queries by.

Filepaths

Key

Description

filepaths[0]

An image file from the collection whose metadata will be counted.

filepaths[n] (optional)

An image file from the collection whose metadata will be counted.

count_metadata[0]

A metadata query which you want to count.

count_metadata[n] (optional)

A metadata query which you want to count.

Request examples

Collection

curl https://multicolorengine.tineye.com/<company>/rest/count_metadata/ --get                           \
     -F "count_metadata[0]='{\"keywords\": \"dog\"}'"                                                   \
     -F "count_metadata[1]='{\"_or_operator_\": [{\"keywords\": \"whale\"}, {\"keywords\": \"shark\"}]}'"

Metadata

curl https://multicolorengine.tineye.com/<company>/rest/count_metadata/ --get                    \
     -F "metadata='{\"_or_operator_\": [{\"keywords\": \"cat\"}, {\"keywords\": \"cheetah\"}]}'" \
     -F "count_metadata[0]='{\"keywords\": \"dog\"}'"                                            \
     -F "count_metadata[1]='{\"keywords\": \"whale\"}'"

Colors

curl https://multicolorengine.tineye.com/<company>/rest/count_metadata/ --get                                   \
     -F "colors[0]=255,112,223"                                                                                 \
     -F "colors[1]=95,136,165"                                                                                  \
     -F "weights[0]=70"                                                                                         \
     -F "weights[1]=30"                                                                                         \
     -F "count_metadata[0]='{\"_or_operator_\": [{\"keywords\": \"dolphin\"}, {\"keywords\": \"octopus\"}]}'"

Filepaths

curl https://multicolorengine.tineye.com/<company>/rest/count_metadata/ --get  \
     -F "filepaths[0]=path/folder/1.jpg"                                       \
     -F "filepaths[1]=path/folder/2.jpg"                                       \
     -F "count_metadata[0]='{\"keywords\": \"cat\"}'"

Response examples

JSON

{
    "method": "count_metadata",
    "status": "ok",
    "error": [],
    "result": [
        {
            "metadata": [
                {
                    "count-metadata": {
                        "count": "1",
                        "": {
                            "keywords": "dog"
                        }
                    }
                },
                {
                    "count-metadata": {
                        "count": "4",
                        "": {
                            "_or_operator_": [
                                {
                                    "keywords": "whale"
                                },
                                {
                                    "keywords": "shark"
                                }
                            ]
                        }
                    }
                }
            ]
        }
    ],
    "stats": {
        "time_count": 3.79,
        "time_total": 4.57
    }
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
    <method>count_metadata</method>
    <status>ok</status>
    <error/>
    <result>
        <item>
            <metadata>
                <count-metadata count="1">
                    <keywords>dog</keywords>
                </count-metadata>
                <count-metadata count="4">
                    <_or_operator_>
                        <keywords>whale</keywords>
                        <keywords>shark</keywords>
                    </_or_operator_>
                </count-metadata>
            </metadata>
        </item>
    </result>
    <stats>
        <time_count>3.79</time_count>
        <time_total>4.57</time_total>
    </stats>
</data>