GET get_metadata

Given a list of image file paths, retrieve the associated metadata from the index.

Resource URL

https://wineengine.tineye.com/<company>/rest/get_metadata/

Notes

The metadata returned for each image might contain the wine’s variety, vintage, color, region and country along with the location information so that you can highlight them on your images. Also it will contain the location information for the wine label itself. The metadata will also include all the words extracted from the wine label.

The locations returned by WineEngine will always refer to the image stored in the index and are provided as bounding boxes. These bounding boxes will be described using four percentage values (left, right, top, bottom) computed relative to image’s dimensions.

Please note that if your image has solid color borders, those might be cropped out by WineEngine. In that case the locations returned will only refer to the cropped version of the image.

Each request accepts maximum 10 filepaths.

Parameters

In addition to the Common parameters there are:

Filepath

Key

Description

filepath

A filepath for which metadata will be returned.

Filepaths

Key

Description

filepaths[0]

The first filepath for which metadata will be returned.

filepaths[n] (optional)

The last filepath for which metadata will be returned.

Request example

curl https://wineengine.tineye.com/<company>/rest/get_metadata/   \
     -d "filepath=path/folder/image1.jpg"

or

curl https://wineengine.tineye.com/<company>/rest/get_metadata/   \
     -d "filepaths[0]=path/folder/image1.jpg"                     \
     -d "filepaths[1]=path/folder/image2.jpg"

Response examples

JSON

{
    "method": "get_metadata",
    "status": "ok",
    "error": [],
    "result": [
        {
            "filepath": "path/folder/image1.jpg",
            "metadata": {
                "image_id": "dd8d-6dc8-bf3f",
                "variety_type": "Zinfandel",
                "variety_rect": {
                    "left": 17.85,
                    "right": 46.24,
                    "top": 45.16,
                    "bottom": 52.26
                },
                "vintage_year": 2013,
                "vintage_rect": {
                    "left": 19.57,
                    "right": 28.39,
                    "top": 66.29,
                    "bottom": 70.81
                },
                "color_type": "Red Wine",
                "color_rect": {
                    "left": 22.3,
                    "right": 51.25,
                    "top": 35.41,
                    "bottom": 56.32
                },
                "region_name": "Dry Creek Valley",
                "region_rect": {
                    "left": 19.14,
                    "right": 43.87,
                    "top": 74.84,
                    "bottom": 81.13
                },
                "country_name_inferred": "United States",
                "misc_fields": [
                    "Sparkling",
                    "Gran Reserva"
                ],
                "label_rect": {
                    "left": 11.61,
                    "right": 80.86,
                    "top": 2.58,
                    "bottom": 88.71
                },
                "text_tokens": [
                    "quivira",
                    "vineyards",
                    "black",
                    "boar",
                    "zinfandel",
                    "2013",
                    "dry",
                    "creek",
                    "valley",
                    "sonoma",
                    "county"
                ]
            }
        },
        {
            "filepath": "path/folder/image2.jpg",
            "metadata": {
                "image_id": "db9561-7cecb6",
                "variety_type": "Malbec",
                "variety_rect": {
                    "left": 35.76,
                    "right": 45.8,
                    "top": 42.3,
                    "bottom": 46
                },
                "vintage_year": 2014,
                "vintage_rect": {
                    "left": 38.46,
                    "right": 43.18,
                    "top": 45.5,
                    "bottom": 48
                },
                "region_name": "Valle de Uco",
                "region_rect": {
                    "left": 30.28,
                    "right": 48.73,
                    "top": 76.2,
                    "bottom": 80.4
                },
                "country_name": "Argentina",
                "country_rect": {
                    "left": 38.68,
                    "right": 47.38,
                    "top": 81.2,
                    "bottom": 84.3
                },
                "misc_fields": [
                    "Dessert",
                    "Premier Cru"
                ],
                "label_rect": {
                    "left": 20.31,
                    "right": 59.97,
                    "top": 5.6,
                    "bottom": 91.1
                },
                "text_tokens": [
                    "salentein",
                    "reserve",
                    "malbec",
                    "2014",
                    "ptima",
                    "exposicion",
                    "soiaryagua",
                    "pura",
                    "ascondicions",
                    "ideales",
                    "para",
                    "habonar",
                    "vinos",
                    "qur",
                    "son",
                    "maxima",
                    "del",
                    "vaelr",
                    "deuco",
                    "valle",
                    "uco",
                    "agentina"
                ],
            }
        }
    ],
    "stats": {
        "time_get_metadata": 11.21,
        "time_total": 11.39
    }
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
    <method>get_metadata</method>
    <status>ok</status>
    <error/>
    <result>
        <item>
            <filepath>path/folder/image1.jpg</filepath>
            <metadata>
                <image_id>dd8d-6dc8-bf3f</image_id>
                <variety_type>Zinfandel</variety_type>
                <variety_rect>
                    <left>17.85</left>
                    <right>46.24</right>
                    <top>45.16</top>
                    <bottom>52.26</bottom>
                </variety_rect>
                <vintage_year>2013</vintage_year>
                <vintage_rect>
                    <left>19.57</left>
                    <right>28.39</right>
                    <top>66.29</top>
                    <bottom>70.81</bottom>
                </vintage_rect>
                <color_type>Red Wine</color_type>
                <color_rect>
                    <left>22.3</left>
                    <right>51.25</right>
                    <top>35.41</top>
                    <bottom>56.32</bottom>
                </color_rect>
                <region_name>Dry Creek Valley</region_name>
                <region_rect>
                    <left>19.14</left>
                    <right>43.87</right>
                    <top>74.84</top>
                    <bottom>81.13</bottom>
                </region_rect>
                <country_name_inferred>United States</country_name_inferred>
                <misc_fields>
                    <item>Sparkling</item>
                    <item>Gran Reserva</item>
                </misc_fields>
                <label_rect>
                    <left>11.61</left>
                    <right>80.86</right>
                    <top>2.58</top>
                    <bottom>88.71</bottom>
                </label_rect>
                <text_tokens>
                    <item>quivira</item>
                    <item>vineyards</item>
                    <item>black</item>
                    <item>boar</item>
                    <item>zinfandel</item>
                    <item>2013</item>
                    <item>dry</item>
                    <item>creek</item>
                    <item>valley</item>
                    <item>sonoma</item>
                    <item>county</item>
                </text_tokens>
            </metadata>
        </item>
        <item>
            <filepath>path/folder/image2.jpg</filepath>
            <metadata>
                <image_id>db9561-7cecb6</image_id>
                <variety_type>Malbec</variety_type>
                <variety_rect>
                    <left>35.76</left>
                    <right>45.8</right>
                    <top>42.3</top>
                    <bottom>46.0</bottom>
                </variety_rect>
                <vintage_year>2014</vintage_year>
                <vintage_rect>
                    <left>38.46</left>
                    <right>43.18</right>
                    <top>45.5</top>
                    <bottom>48.0</bottom>
                </vintage_rect>
                <region_name>Valle de Uco</region_name>
                <region_rect>
                    <left>30.28</left>
                    <right>48.73</right>
                    <top>76.2</top>
                    <bottom>80.4</bottom>
                </region_rect>
                <country_name>Argentina</country_name>
                <country_rect>
                    <left>38.68</left>
                    <right>47.38</right>
                    <top>81.2</top>
                    <bottom>84.3</bottom>
                </country_rect>
                <misc_fields>
                    <item>Dessert</item>
                    <item>Premier Cru</item>
                </misc_fields>
                <label_rect>
                    <left>20.31</left>
                    <right>59.97</right>
                    <top>5.6</top>
                    <bottom>91.1</bottom>
                </label_rect>
                <text_tokens>
                    <item>salentein</item>
                    <item>reserve</item>
                    <item>malbec</item>
                    <item>2014</item>
                    <item>ptima</item>
                    <item>exposicion</item>
                    <item>soiaryagua</item>
                    <item>pura</item>
                    <item>ascondicions</item>
                    <item>ideales</item>
                    <item>para</item>
                    <item>habonar</item>
                    <item>vinos</item>
                    <item>qur</item>
                    <item>son</item>
                    <item>maxima</item>
                    <item>del</item>
                    <item>vaelr</item>
                    <item>deuco</item>
                    <item>valle</item>
                    <item>uco</item>
                    <item>agentina</item>
                </text_tokens>
            </metadata>
        </item>
    </result>
    <stats>
        <time_get_metadata>11.21</time_get_metadata>
        <time_total>11.39</time_total>
    </stats>
</data>