POST extract_metadata¶
Given a list of images or of image URLs, extract the associated metadata.
Resource URL¶
https://wineengine.tineye.com/<company>/rest/extract_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 input images 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.
Parameters¶
In addition to the Common parameters there are:
Image¶
Key |
Description |
---|---|
image |
An image file object whose label metadata will be extracted. |
Images¶
Key |
Description |
---|---|
images[0] |
An image file object whose label metadata will be extracted. |
… |
… |
images[n] (optional) |
An image file object whose label metadata will be extracted. |
URL¶
Key |
Description |
---|---|
url |
A URL of an image file whose label metadata will be extracted. |
URLs¶
Key |
Description |
---|---|
urls[0] |
A URL of an image file whose label metadata will be extracted. |
… |
… |
urls[n] (optional) |
A URL of an image file whose label metadata will be extracted. |
Request examples¶
Images¶
curl https://wineengine.tineye.com/<company>/rest/extract_metadata/ \
-F "image=@image1.jpg"
or
curl https://wineengine.tineye.com/<company>/rest/extract_metadata/ \
-F "images[0]=@image1.jpg" \
-F "images[1]=@image2.jpg"
URLs¶
curl https://wineengine.tineye.com/<company>/rest/extract_metadata/ \
-F "url=http://example.com/image1.jpg"
or
curl https://wineengine.tineye.com/<company>/rest/extract_metadata/ \
-F "urls[0]=http://example.com/image1.jpg" \
-F "urls[1]=http://example.com/image2.jpg"
Response examples¶
JSON¶
{
"method": "extract_metadata",
"status": "ok",
"error": [],
"result": [
{
"filepath": "image1.jpg",
"metadata": {
"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": "image2.jpg",
"metadata": {
"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_download": 84.81,
"time_resize": 51.65,
"time_detect_label": 204.62,
"time_extract_text": 162.84,
"time_total": 505.87
}
}
XML¶
<?xml version="1.0" encoding="utf-8"?>
<data>
<method>extract_metadata</method>
<status>ok</status>
<error/>
<result>
<item>
<filepath>image1.jpg</filepath>
<metadata>
<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>image2.jpg</filepath>
<metadata>
<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_download>84.81</time_download>
<time_resize>51.65</time_resize>
<time_detect_label>204.62</time_detect_label>
<time_extract_text>162.84</time_extract_text>
<time_total>505.87</time_total>
</stats>
</data>