hardikvasa / google-images-download

Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!
MIT License
8.58k stars 2.11k forks source link

All image cannot be downloaded on google colab. #331

Open Fliw opened 4 years ago

Fliw commented 4 years ago

Hello there, i was using this package as an img downloader to train my Artificial intelligence project, after installing this package using pip, i ran code like this :

response = google_images_download.googleimagesdownload()
arguments = {"keywords":"people wearing mask","limit":60,"print_urls":False}
paths = response.download(arguments)
print(paths)

after executing the cell i got the response like this :

Item no.: 1 --> Item name = people wearing mask
Evaluating...
Starting Download...

Unfortunately all 60 could not be downloaded because some images were not downloadable. 0 is all we got for this search filter!

Errors: 0

({'people wearing mask': []}, 0)

why? is the frontend of google has change or what? can you help me??

k-fillmore commented 4 years ago

Having the same issue

for i in df['Breed']: arguments={"keywords":i,"output_directory":'./Images/'+i+'/',"limit":100,"print_urls":True,'chromedriver':'./chromedriver','delay':1} paths = response.download(arguments) # passing the arguments to the function print(paths) # printing absolute paths of the downloaded images'''

Item no.: 1 --> Item name = Weimaraner Evaluating... Starting Download... Unfortunately all 100 could not be downloaded because some images were not downloadable. 0 is all we got for this search filter!

Joeclinton1 commented 4 years ago

Have you tried my fork which fixes this problem? #298

git clone https://github.com/Joeclinton1/google-images-download.git cd google-images-download && python setup.py install

Fliw commented 4 years ago

Have you tried my fork which fixes this problem? #298

git clone https://github.com/Joeclinton1/google-images-download.git cd google-images-download && python setup.py install

Thank you so much, i'll try it tomorrow! I'm really sad to see that this repo is so much potential, so much who interest, so much who send PR but not maintained and abandoned by creator :(

riffAt2013 commented 4 years ago

@Joeclinton1 thanks for the fork! It works..sort of.

Was going for the script based example at first, directly from the docs:

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 images

It didn't work, oddly, showing ModuleNotFoundError.

However it worked from the command line nicely. Any possible explanations?

Hardik-G1 commented 4 years ago

Have you tried my fork which fixes this problem? #298

git clone https://github.com/Joeclinton1/google-images-download.git cd google-images-download && python setup.py install

Does the format filter does not work in this i am trying this but it is still downloading jpeg and webp formats

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,"format":"jpg"}
paths = response.download(arguments)