From 758602403eb92625608d04e7d77fcbf896c55e2d Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Sun, 21 Sep 2025 21:35:22 +0200 Subject: [PATCH] replace loky with concurrent.futures.ProcessPoolExecutor (faster) --- src/eynollah/eynollah.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eynollah/eynollah.py b/src/eynollah/eynollah.py index 6333ca5..1c70498 100644 --- a/src/eynollah/eynollah.py +++ b/src/eynollah/eynollah.py @@ -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"