Made all processes threaded. Also changed up the neural network to hopefully better support the higher class load

This commit is contained in:
Lucas Oskorep
2019-04-26 02:57:18 -05:00
parent 493f5cfb25
commit 24e8d71306
4 changed files with 160 additions and 91 deletions
+12 -9
View File
@@ -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)