Skip to main content

Google-Images-Download

Background​

To use the no code ai (lobe.ai), we need to get the proper images for the model. There is a python library called the google-images-download. But google-image-download no longer works after 2020. I found the solution so i want to share the content.

Develop environment​

  • windows 10
  • miniconda3 (Miniconda3-py37_4.10.3-Windows-x86_64)

Github issue​

Unfortunately all 20 could not be downloaded because some images were not downloadable Github Issue.

Solution​

Joeclinton1 solved the issue. Solution

Installation on windows​

conda install selenium
git clone https://github.com/Joeclinton1/google-images-download.git
cd google-images-download

Open the windows cmd terminal.

python setup.py install

Add the index.py on the same folder.

/google-images-download/index.py
from google_images_download import google_images_download   #importing the library

response = google_images_download.googleimagesdownload() #class instantiation

arguments = {"keywords":"Polar bears,baloons,Beaches","limit":20,"print_urls":True} #creating list of arguments
paths = response.download(arguments) #passing the arguments to the function
print(paths) #printing absolute paths of the downloaded imagess

You could see the downloads folder after the downloads are succeeded.