JorgePoblete / DuckDuckGoImages

Search and download images using DuckDuckGo search engine
MIT License
15 stars 4 forks source link

Added tqdm progress bar for sequential and parallel downloads #2

Closed Nachimak28 closed 2 years ago

Nachimak28 commented 2 years ago

Hi, I used this library for my pet projects to build image classifiers and can't thank you enough given how Google has restricted image scraping. While using the lib, I found that adding a tqdm progress bar while downloading helped me a lot as I was checking every now and then the contents in my folder. I took the liberty to add a TQDM based progress for both the sequential and parallel downloads and tested it rigorously for python versions 3.6, 3.7, 3.8 and 3.9 on a Windows 10 machine. Also replicated the testing using a script as well as a jupyter notebook. (Check screenshots below) without it affecting any other functionality.

Script based testing duck_terminal_test

Notebook based testing duck_notebook_test

In case you wish to merge this into master after reviewing the code, it would be great. Also if you wish that I make any changes to the code to make it further compliant with code formatting or preferred folder structure, please do let me know. For now the progress bar is by default shown always on calling the download function, if you wish to add a flag to toggle the displaying of progress bar, I would be happy to do those changes too.

JorgePoblete commented 2 years ago

Hi @Nachimak28!, this looks good to me, it's funny that you are using this exactly for the reason i made it hahahaah i made this when i wanted a bunch of images to train classifiers, it's a one weekend project, so it works, but it can be improve.

i didn't add a tqdm progress bar in this just because i have it in another library that i used to train models hahaha but its a nice feature to have so it will be added.

Thanks for adding this feature and feel free to add or request other things that can be useful, i check on this repo from time to time.

Again thanks :D