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