Skip to content

Instantly share code, notes, and snippets.

@faisalburhanudin
Last active October 18, 2018 08:15
Show Gist options
  • Select an option

  • Save faisalburhanudin/553c146c97b3097543b68e88978694b0 to your computer and use it in GitHub Desktop.

Select an option

Save faisalburhanudin/553c146c97b3097543b68e88978694b0 to your computer and use it in GitHub Desktop.
from google_images_download import google_images_download
def download_datasets(keyword: str, saver, limit: int = 100):
"""Download image from google and save object to saver
:param keyword: keyword search
:param saver: function for save image
:param limit: limit per download
"""
response = google_images_download.googleimagesdownload()
absolute_image_paths = response.download({
"keywords": keyword,
"limit": limit
})
for key, value in absolute_image_paths.items():
# save images, change to your storage function
saver(value, key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment