Remove Multi-threaded image conversion for fast image processors (#36105)

remove multithreaded image conversion

Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
This commit is contained in:
Yoni Gozlan
2025-02-10 07:59:34 -05:00
committed by GitHub
parent 3897f2caf8
commit 924f1c717a

View File

@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from concurrent.futures import ThreadPoolExecutor
from functools import lru_cache, partial from functools import lru_cache, partial
from typing import Any, Dict, Iterable, List, Optional, Tuple, TypedDict, Union from typing import Any, Dict, Iterable, List, Optional, Tuple, TypedDict, Union
@@ -497,8 +496,10 @@ class BaseImageProcessorFast(BaseImageProcessor):
input_data_format=input_data_format, input_data_format=input_data_format,
device=device, device=device,
) )
with ThreadPoolExecutor() as executor: # todo: yoni - check if we can parallelize this efficiently
processed_images = list(executor.map(process_image_fn, images)) processed_images = []
for image in images:
processed_images.append(process_image_fn(image))
return processed_images return processed_images