Made all processes threaded. Also changed up the neural network to hopefully better support the higher class load
This commit is contained in:
+12
-9
@@ -3,23 +3,26 @@ import multiprocessing
|
||||
|
||||
from google_images_download import google_images_download
|
||||
|
||||
df = pd.read_csv("pokemon.csv")
|
||||
|
||||
response = google_images_download.googleimagesdownload()
|
||||
|
||||
|
||||
def get_images_for_pokemon(pokemon):
|
||||
response = google_images_download.googleimagesdownload()
|
||||
response.download(
|
||||
{
|
||||
"keywords": pokemon,# + " pokemon",
|
||||
"keywords": pokemon + " pokemon",
|
||||
"limit": 250,
|
||||
"chromedriver": "chromedriver",
|
||||
"thumbnail":True
|
||||
# Add chromedriver to your path or just point this var directly to your chromedriver
|
||||
"thumbnail": True
|
||||
# Add chromedriver to your path or just point this var directly to your chromedriverv
|
||||
}
|
||||
)
|
||||
|
||||
pool = multiprocessing.Pool(multiprocessing.cpu_count()*4)
|
||||
|
||||
pool.map(get_images_for_pokemon, df["identifier"][:490])
|
||||
# freeze_support()
|
||||
df = pd.read_csv("pokemon.csv")
|
||||
|
||||
pool = multiprocessing.Pool(multiprocessing.cpu_count()*3)
|
||||
fixes = []
|
||||
pool.map(get_images_for_pokemon, [fixes])#df["identifier"]
|
||||
|
||||
# for pokemon in df["identifier"][:490]:
|
||||
# get_images_for_pokemon(pokemon)
|
||||
Reference in New Issue
Block a user