您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

什么是必应视觉搜索 API?What is the Bing Visual Search API?

必应视觉搜索 API 返回图像见解。The Bing Visual Search API returns insights for an image. 你可以上传图像,也可以提供图像的 URL。You can either upload an image or provide a URL to one. 见解是视觉上类似的图像、购物源、包含图像的网页,等等。Insights are visually similar images, shopping sources, webpages that include the image, and more. 必应视觉搜索 API 返回的见解类似于 Bing.com/images 上显示的见解。Insights returned by the Bing Visual Search API are similar to ones shown on Bing.com/images.

如果使用必应图像搜索 API,则可以使用该 API 的搜索结果中的见解标记,而无需上传图像。If you use the Bing Image Search API, you can use insight tokens from that API's search results for your Bing Visual Search instead of uploading an image.

重要

如果使用必应图像搜索 API 获取图像见解,请考虑切换到必应视觉搜索 API,因为它可以提供更全面的见解。If you get image insights using the Bing Image Search API, consider switching to the Bing Visual Search API, which provides more comprehensive insights.

洞察力Insights

可以使用必应视觉搜索发现以下见解:You can discover the following insights by using Bing Visual Search:

见解Insight 说明Description
视觉上相似的图像Visually similar images 与输入图像在外观上相似的图像列表。A list of images that are visually similar to the input image.
外观相似的产品Visually similar products 与所示产品外观相似的产品。Products that are visually similar to the product shown.
购物源Shopping sources 可以购买输入图像中所示项的位置。Places where you can buy the item shown in the input image.
相关搜索Related searches 其他人执行的相关搜索或基于图像内容的相关搜索。Related searches made by others or that are based on the contents of the image.
包含图像的网页Webpages that include the image 包含输入图像的网页。Webpages that include the input image.
食谱Recipes 包含输入图像中所示食物的食谱的网页。Webpages that include recipes for making the dish shown in the input image.
实体Entities 知名人物、场所和事物。Well-known people, places, and things.

除了这些见解,必应视觉搜索还可以返回各种派生自输入图像的不同字词(即标记)。In addition to insights, Bing Visual Search returns a variety of terms (that is, tags) derived from the input image. 这些标记可让用户浏览在图像中找到的概念。The tags enable users to explore concepts found in the image. 例如,如果输入图像是一位著名运动员,则其中一个标记可能是运动员的姓名,另一个标记可能是“体育”。For example, if the input image is of a famous athlete, one of the tags may be the name of the athlete, another tag could be Sports. 或者,如果输入图像是一个苹果馅饼,则标记可能是“苹果馅饼”、“馅饼”和“甜点”。Or, if the input image is of an apple pie, the tags could be Apple Pie, Pies, and Desserts.

必应视觉搜索结果还包含图像中感兴趣区域对应的边框。Bing Visual Search results also include bounding boxes for regions of interest in the image. 例如,如果图像包含多个名人,结果可能包含每个已识别名人对应的边框。For example, if the image contains several celebrities, the results may include bounding boxes for each of the recognized celebrities. 或者,如果必应识别图像中的产品或服装,结果可能包含已识别项对应的边框。Or, if Bing recognizes a product or clothing in the image, the result may include a bounding box for the recognized item.

工作流Workflow

必应视觉搜索 API 是一项 RESTful Web 服务,可以轻松地通过任何编程语言调用,只要该语言能够发出 HTTP 请求和分析 JSON 即可。The Bing Visual Search API is a RESTful web service, making it easy to call from any programming language that can make HTTP requests and parse JSON. 可以通过 REST API 或 SDK 使用此服务。You can use either the REST API or the SDK for the service.

  1. 创建一个认知服务帐户用于访问必应搜索 API。Create a Cognitive Services account to access the Bing Search APIs. 如果没有 Azure 订阅,可以免费创建一个帐户If you don't have an Azure subscription, you can create an account for free.
  2. 使用有效的搜索查询向 API 发送请求。Send a request to the API with a valid search query.
  3. 通过分析返回的 JSON 消息处理 API 响应。Process the API response by parsing the returned JSON message.

后续步骤Next steps

首先,请尝试必应视觉搜索 API 交互式演示First, try the Bing Visual Search API interactive demo. 该演示介绍如何快速自定义搜索查询并在 Web 中搜索图像。The demo shows how you can quickly customize a search query and scour the web for images.

若要快速了解如何使用第一个请求,请参阅快速入门:C# | Java | node.js | PythonTo get started quickly with your first request, see the quickstarts: C# | Java | node.js | Python.

另请参阅See also