@@ -19,13 +20,14 @@ from util.file_utils import File
fromutil.utilsimportImageUtils
fromutil.utilsimportTimeUtils
importcv2
fromextractorimportExtractor
from.extractorimportExtractor
fromtqdmimporttqdm
importsys
ifnotsys.warnoptions:
importwarnings
warnings.simplefilter("ignore")
classFeatureExtractor(object):
"""Handle the feature extraction."""
...
...
@@ -96,11 +98,14 @@ class FeatureExtractor(object):
self.job_extractor(dataset,cl,classes)
self.print_console("Wait a moment, the threads are processing "+str(len(self.threads))+" images, it may be delayed depending on the size or quantity of the images!")
print("Number of Cores: "+str(multiprocessing.cpu_count()))
#Start threads
withtqdm(total=len(self.threads))aspbar:
fortinself.threads:
t.start()
if(len(multiprocessing.active_children())>10):
t.join()
gc.collect()
pbar.update(1)
pbar.close()
...
...
@@ -108,6 +113,7 @@ class FeatureExtractor(object):
withtqdm(total=len(self.threads))asppbar:
fortinself.threads:
t.join()
delt
ppbar.update(1)
ppbar.close()
self.print_console("The process was completed with "+str(len(self.threads))+" images!")
...
...
@@ -132,6 +138,7 @@ class FeatureExtractor(object):