Skip to content

ultralytics/google-images-download

 
 

Ultralytics logo

🚀 Introduction

Welcome to the Bing Image Scraper, a tool updated and maintained by Ultralytics. This repository provides enhanced code, originally based on the google-images-download project by hardikvasa, specifically adapted for scraping images from Bing. It allows users to efficiently download images for various purposes, such as building datasets for machine learning, performing data analysis, or curating collections for personal projects. Explore more tools and models at Ultralytics.

Ultralytics Actions Ultralytics Discord Ultralytics Forums Ultralytics Reddit

🐳 Docker Run

For easy deployment using Docker, visit the dedicated GitHub repository: google-images-download-by-docker.

You can run the scraper within a Docker container using the following command:

docker run -d -p 80:80 --name image_searcher saitamatechno/google_images_download:v1.0

📋 Requirements

To use this software effectively, please ensure you have Python 3.8 or later installed. You also need to install the necessary dependencies listed in the requirements.txt file, which includes libraries like Selenium. Install them using pip:

pip install -r requirements.txt

You can find the requirements.txt file here.

⚙️ Installation

To set up the Bing image scraper on your local machine, clone this repository and install the required dependencies:

git clone https://github.com/ultralytics/google-images-download
cd google-images-download
pip install -r requirements.txt

🖥️ How to Run

Follow these steps to run the image scraper:

  1. Install Google Chrome: Ensure Google Chrome is installed on your system. If not, download it from the official Google Chrome website.
  2. Download ChromeDriver: Get the correct version of ChromeDriver that matches your installed Chrome version. Download links and instructions are available on the ChromeDriver documentation page. Make sure to note the path to the downloaded chromedriver executable.
  3. Execute the Script: Run the bing_scraper.py script using Python. You can specify a Bing Images search results URL using the --url argument or provide search terms directly with the --search argument. Images will be saved to the ./images directory by default. The script is designed to skip images that cause errors during download. For insights into data collection best practices, check out our blog post on exploring data labeling.

Example using a URL:

python3 bing_scraper.py --url 'https://www.bing.com/images/search?q=wildflowers' --limit 20 --download --chromedriver /path/to/your/chromedriver

Example using search terms:

python3 bing_scraper.py --search 'bees collecting pollen' --limit 15 --download --chromedriver /path/to/your/chromedriver

# Output logs will show download progress and any encountered errors.

The downloaded images can be useful for creating custom computer vision datasets.

Example output showing downloaded images in a folder

📜 Citing the Project

If you use this software in your research or projects, please acknowledge the original work by citing the hardikvasa/google-images-download repository.

🤝 Contributing

Contributions from the community are highly encouraged and appreciated! Your input helps make this open-source tool better for everyone. Whether it's reporting a bug, suggesting a new feature, or submitting code improvements, please refer to our Contributing Guide for details on how to get started.

We also invite you to participate in our Survey to share your feedback, helping us understand your needs and improve our offerings. A heartfelt thank you 🙏 to all our contributors for their dedication and support!

Ultralytics open-source contributors

🔏 License

Ultralytics provides two licensing options to accommodate different usage needs:

  • AGPL-3.0 License: Ideal for students, researchers, and enthusiasts working on open-source projects. It promotes collaboration and knowledge sharing. See the LICENSE file for full details.
  • Enterprise License: Designed for commercial use cases, this license allows integration of Ultralytics software into proprietary products and services without the open-source requirements of AGPL-3.0. For more information, visit Ultralytics Licensing.

📬 Contact

For bug reports, feature requests, or any issues related to this repository, please use the GitHub Issues tracker. For broader questions, discussions, and community interaction, join our Discord server.


Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics BiliBili space Ultralytics Discord