Skip to main content
  • Tutorial
  • Computer vision

Build your own image dataset with the Bing Image Search API

A step-by-step Python guide for building your own image dataset using the Bing Image Search API, from search and download to storing results in Azure Machine Learning Studio.

Mar 1, 2020
Close Up Of Motherboard

Need training data for image classification but can't find it on Kaggle? The Bing Image Search API (part of Azure Cognitive Services) lets you search for images programmatically, filtering by size, file size, licence, and colour.

01

The workflow

In Python: install the Bing Image Search SDK, configure your subscription key and endpoint, search with your keyword and desired count, convert results to a Pandas DataFrame, generate unique filenames using MIME type detection and UUIDs, then download images with error handling for broken links. The whole script can be parametrised to accept an array of search terms for batch downloading.

02

Moving data to Azure ML Studio

If you're using Azure Machine Learning Studio, upload the image folder to a datastore so other data scientists can access it too. A few lines of code with the azureml.core library handle the upload.

The full Jupyter Notebook is available on GitHub.

Want to work together

Project in mind?

Start with a conversation, or with the readiness check. Either way, you talk to the people who build it.