mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-10-07 06:59:58 +02:00
replace loky with concurrent.futures.ProcessPoolExecutor (faster)
This commit is contained in:
parent
0366707136
commit
758602403e
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ import gc
|
|||
import copy
|
||||
import json
|
||||
|
||||
from loky import ProcessPoolExecutor
|
||||
from concurrent.futures import ProcessPoolExecutor
|
||||
import xml.etree.ElementTree as ET
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
@ -244,7 +244,7 @@ class Eynollah:
|
|||
self.num_col_lower = num_col_lower
|
||||
self.logger = logger if logger else getLogger('eynollah')
|
||||
# for parallelization of CPU-intensive tasks:
|
||||
self.executor = ProcessPoolExecutor(max_workers=cpu_count(), timeout=1200)
|
||||
self.executor = ProcessPoolExecutor(max_workers=cpu_count())
|
||||
atexit.register(self.executor.shutdown)
|
||||
self.dir_models = dir_models
|
||||
self.model_dir_of_enhancement = dir_models + "/eynollah-enhancement_20210425"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue