Commit
•
d3e7778
1
Parent(s):
194f168
imap bug fix
Browse files- utils/datasets.py +1 -1
utils/datasets.py
CHANGED
@@ -477,7 +477,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
|
477 |
if cache_images:
|
478 |
gb = 0 # Gigabytes of cached images
|
479 |
self.img_hw0, self.img_hw = [None] * n, [None] * n
|
480 |
-
results = ThreadPool(8).
|
481 |
pbar = tqdm(enumerate(results), total=n)
|
482 |
for i, x in pbar:
|
483 |
self.imgs[i], self.img_hw0[i], self.img_hw[i] = x # img, hw_original, hw_resized = load_image(self, i)
|
|
|
477 |
if cache_images:
|
478 |
gb = 0 # Gigabytes of cached images
|
479 |
self.img_hw0, self.img_hw = [None] * n, [None] * n
|
480 |
+
results = ThreadPool(8).imap(lambda x: load_image(*x), zip(repeat(self), range(n))) # 8 threads
|
481 |
pbar = tqdm(enumerate(results), total=n)
|
482 |
for i, x in pbar:
|
483 |
self.imgs[i], self.img_hw0[i], self.img_hw[i] = x # img, hw_original, hw_resized = load_image(self, i)
|