Sfoglia il codice sorgente

added a README file

Dimitri Korsch 6 anni fa
parent
commit
8aab0c584a
3 ha cambiato i file con 46 aggiunte e 2 eliminazioni
  1. 1 0
      .gitignore
  2. 43 0
      README.md
  3. 2 2
      run.py

+ 1 - 0
.gitignore

@@ -98,6 +98,7 @@ ENV/
 # mypy
 .mypy_cache/
 
+README.html
 download
 *.txt
 *.csv

+ 43 - 0
README.md

@@ -0,0 +1,43 @@
+# Google Image Crawler
+
+
+
+## Installation:
+Requires `>=python3.6` and `pip`!
+
+```bash
+pip install -r requirements.txt
+```
+## Usage:
+Given a file (`queries.txt`) with following search queries:
+
+```
+001.Black_footed_Albatross
+002.Laysan_Albatross
+003.Sooty_Albatross
+004.Groove_billed_Ani
+# 005.Crested_Auklet
+006.Least_Auklet
+007.Parakeet_Auklet
+# 008.Rhinoceros_Auklet
+009.Brewer_Blackbird
+010.Red_winged_Blackbird
+011.Rusty_Blackbird
+012.Yellow_headed_Blackbird
+013.Bobolink
+014.Indigo_Bunting
+...
+```
+you can use the main script to download images for each line (excluding lines beginning with a `#`!) of the query file:
+
+```bash
+python run.py queries.txt -o downloads -l 20
+```
+
+See `python run.py --help` for more argument options and its documentation.
+
+
+## Notes about query strings:
+* everything before the first `.` is removed (`something.query`, `query` and `003.query` are handled equally)
+* all `_` are replaced with ` ` (`some_query` and `some query` are handled equally)
+* all capitals are converted to lower case (`SOME QUERY`, `Some Query` and `some query` are handled equally)

+ 2 - 2
run.py

@@ -21,8 +21,8 @@ def main(args):
 	with open(args.classnames, "r") as f:
 		names = f.readlines()
 
-	# query_names = [name.strip().partition(".")[-1].replace("_", " ").lower() for name in names if not name.startswith("#")]
-	query_names = [name.strip() for name in names if not name.startswith("#")]
+	query_names = [name.strip().partition(".")[-1].replace("_", " ").lower() for name in names if not name.startswith("#")]
+	# query_names = [name.strip() for name in names if not name.startswith("#")]
 
 	response = google_images_download.googleimagesdownload()   #class instantiation