From b5ed1101b454fc28f8056966cc745434ce59f1c7 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Fri, 5 Jan 2024 21:16:10 -0600 Subject: [PATCH] use result size helper --- api/onnx_web/chain/pipeline.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/api/onnx_web/chain/pipeline.py b/api/onnx_web/chain/pipeline.py index c785fce0..409545b9 100644 --- a/api/onnx_web/chain/pipeline.py +++ b/api/onnx_web/chain/pipeline.py @@ -160,16 +160,11 @@ class ChainPipeline: kwargs.pop("params") # the stage must be split and tiled if any image is larger than the selected/max tile size - must_tile = has_mask(stage_kwargs) or any( - [ - needs_tile( - stage_pipe.max_tile, - stage_params.tile_size, - size=kwargs.get("size", None), - source=source, - ) - for source in stage_sources.as_images() - ] + must_tile = has_mask(stage_kwargs) or needs_tile( + stage_pipe.max_tile, + stage_params.tile_size, + size=kwargs.get("size", None), + source=stage_sources.size(), ) tile = stage_params.tile_size