Skip to content

Commit 70f7cce

Browse files
Merge pull request #100477 from aahill/visual-search-backend-update
[CogSvcs][Bing Visual Search] updating parameter info
2 parents ec62438 + 323978f commit 70f7cce

File tree

1 file changed

+90
-26
lines changed

1 file changed

+90
-26
lines changed

articles/cognitive-services/bing-visual-search/concepts/sending-queries.md

Lines changed: 90 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-visual-search
1111
ms.topic: conceptual
12-
ms.date: 08/30/2019
12+
ms.date: 01/08/2019
1313
ms.author: aahi
1414
---
1515

@@ -117,6 +117,26 @@ Content-Disposition: form-data; name="knowledgeRequest"
117117
--boundary_1234-abcd--
118118
```
119119

120+
You can optionally set the `enableEntityData` attribute in the header to `true` for detailed information on the main entity in the image you upload, including links to the web and attribution information. This field is `false` by default.
121+
122+
```
123+
--boundary_1234-abcd
124+
Content-Disposition: form-data; name="knowledgeRequest"
125+
126+
{
127+
"imageInfo" : {
128+
"url" : "https://contoso.com/2018/05/fashion/red.jpg"
129+
},
130+
"knowledgeRequest" : {
131+
"invokedSkillsRequestData" : {
132+
"enableEntityData" : "true"
133+
}
134+
}
135+
}
136+
137+
--boundary_1234-abcd--
138+
```
139+
120140
If you upload a local image, the following snippet shows the form data you must include in the body of the POST. The form data must include the `Content-Disposition` header. Its `name` parameter must be set to "image" and the `filename` parameter may be set to any string. The `Content-Type` header may be set to any commonly used image mime type. The contents of the form is the binary data of the image. The maximum image size you may upload is 1 MB. The largest of the width or height should be 1,500 pixels or less.
121141

122142
```
@@ -364,37 +384,81 @@ Text recognition can also recognize the contact information on business cards, s
364384
}
365385
```
366386

367-
If the image contains a recognized entity such as a culturally well-known/popular person, place, or thing, one of the tags may include an Entity insight.
387+
If the image contains a recognized entity such as a culturally well-known/popular person, place, or thing, one of the tags may include an Entity insight. The `mainEntity` and `data` fields are only available if the `enableEntityData` attribute in the `Content-Type` header is set to `true`.
368388

369389
```json
390+
{
391+
"image" : {
392+
"thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?q=Statue+of+Liberty..."
393+
},
394+
"displayName" : "Statue of Liberty",
395+
"boundingBox" : {
396+
"queryRectangle" : {
397+
"topLeft" : {"x" : 0.40625, "y" : 0.1757813},
398+
"topRight" : {"x" : 0.6171875, "y" : 0.1757813},
399+
"bottomRight" : {"x" : 0.6171875, "y" : 0.3867188},
400+
"bottomLeft" : {"x" : 0.40625, "y" : 0.3867188}
401+
},
402+
"displayRectangle" : {
403+
"topLeft" : {"x" : 0.40625, "y" : 0.1757813},
404+
"topRight" : {"x" : 0.6171875, "y" : 0.1757813},
405+
"bottomRight" : {"x" : 0.6171875, "y" : 0.3867188},
406+
"bottomLeft" : {"x" : 0.40625, "y" : 0.3867188}
407+
}
408+
},
409+
"actions" : [
370410
{
371-
"image" : {
372-
"thumbnailUrl" : "https:\/\/tse4.mm.bing.net\/th?q=Statue+of+Liberty..."
373-
},
411+
"_type" : "ImageEntityAction",
412+
"webSearchUrl" : "https:\/\/www.bing.com\/search?q=Statue+of+Liberty",
374413
"displayName" : "Statue of Liberty",
375-
"boundingBox" : {
376-
"queryRectangle" : {
377-
"topLeft" : {"x" : 0.40625, "y" : 0.1757813},
378-
"topRight" : {"x" : 0.6171875, "y" : 0.1757813},
379-
"bottomRight" : {"x" : 0.6171875, "y" : 0.3867188},
380-
"bottomLeft" : {"x" : 0.40625, "y" : 0.3867188}
381-
},
382-
"displayRectangle" : {
383-
"topLeft" : {"x" : 0.40625, "y" : 0.1757813},
384-
"topRight" : {"x" : 0.6171875, "y" : 0.1757813},
385-
"bottomRight" : {"x" : 0.6171875, "y" : 0.3867188},
386-
"bottomLeft" : {"x" : 0.40625, "y" : 0.3867188}
387-
}
414+
"actionType" : "Entity",
415+
"mainEntity" : {
416+
"name" = "Statue of liberty",
417+
"bingId" : "..."
388418
},
389-
"actions" : [
390-
{
391-
"_type" : "ImageEntityAction",
392-
"webSearchUrl" : "https:\/\/www.bing.com\/search?q=Statue+of+Liberty",
393-
"displayName" : "Statue of Liberty",
394-
"actionType" : "Entity",
419+
"data" : {
420+
"id" : "https://api.cognitive.microsoft.com/api/v7/entities/...",
421+
"readLink": "https://www.bingapis.com/api/v7/search?q=...",
422+
"readLinkPingSuffix": "...",
423+
"contractualRules": [
424+
{
425+
"_type": "ContractualRules/LicenseAttribution",
426+
"targetPropertyName": "description",
427+
"mustBeCloseToContent": true,
428+
"license": {
429+
"name": "CC-BY-SA",
430+
"url": "http://creativecommons.org/licenses/by-sa/3.0/",
431+
"urlPingSuffix": "..."
432+
},
433+
"licenseNotice": "Text under CC-BY-SA license"
434+
},
435+
{
436+
"_type": "ContractualRules/LinkAttribution",
437+
"targetPropertyName": "description",
438+
"mustBeCloseToContent": true,
439+
"text": "Wikipedia",
440+
"url": "http://en.wikipedia.org/wiki/...",
441+
"urlPingSuffix": "..."
442+
}
443+
],
444+
"webSearchUrl": "https://www.bing.com/entityexplore?q=...",
445+
"webSearchUrlPingSuffix": "...",
446+
"name": "Statue of Liberty",
447+
"image": {
448+
"thumbnailUrl": "https://tse1.mm.bing.net/th?id=...",
449+
"hostPageUrl": "http://upload.wikimedia.org/wikipedia/...",
450+
"hostPageUrlPingSuffix": "...",
451+
"width": 50,
452+
"height": 50,
453+
"sourceWidth": 474,
454+
"sourceHeight": 598
455+
},
456+
"description" : "...",
457+
"bingId": "..."
395458
}
396-
]
397-
}
459+
}
460+
]
461+
}
398462
```
399463

400464
## See also

0 commit comments

Comments
 (0)