@@ -154,7 +154,7 @@ def cache_is_state(
154154
155155
156156def _precompute_state_for_file (
157- predictor , input_path , output_path , key , ndim , tile_shape , halo , precompute_amg_state , decoder ,
157+ predictor , input_path , output_path , key , ndim , tile_shape , halo , precompute_amg_state , decoder , verbose
158158):
159159 if isinstance (input_path , np .ndarray ):
160160 image_data = input_path
@@ -164,7 +164,7 @@ def _precompute_state_for_file(
164164 # Precompute the image embeddings.
165165 output_path = Path (output_path ).with_suffix (".zarr" )
166166 embeddings = util .precompute_image_embeddings (
167- predictor , image_data , output_path , ndim = ndim , tile_shape = tile_shape , halo = halo , verbose = False
167+ predictor , image_data , output_path , ndim = ndim , tile_shape = tile_shape , halo = halo , verbose = verbose
168168 )
169169
170170 # Precompute the state for automatic instance segmnetaiton (AMG or AIS).
@@ -183,10 +183,10 @@ def _precompute_state_for_file(
183183 ndim = image_data .ndim
184184
185185 if ndim == 2 :
186- cache_function (raw = image_data , verbose = True )
186+ cache_function (raw = image_data , verbose = verbose )
187187 else :
188188 n = image_data .shape [0 ]
189- for i in tqdm (range (n ), total = n , desc = "Precompute instance segmentation state" ):
189+ for i in tqdm (range (n ), total = n , desc = "Precompute instance segmentation state" , disable = not verbose ):
190190 cache_function (raw = image_data , i = i , verbose = False )
191191
192192
@@ -213,6 +213,7 @@ def _precompute_state_for_files(
213213 predictor , file_path , out_path ,
214214 key = key , ndim = ndim , tile_shape = tile_shape , halo = halo ,
215215 precompute_amg_state = precompute_amg_state , decoder = decoder ,
216+ verbose = False ,
216217 )
217218
218219
@@ -262,7 +263,7 @@ def precompute_state(
262263 predictor , input_path , output_path , key ,
263264 ndim = ndim , tile_shape = tile_shape , halo = halo ,
264265 precompute_amg_state = precompute_amg_state ,
265- decoder = decoder ,
266+ decoder = decoder , verbose = True ,
266267 )
267268 else :
268269 input_files = glob (os .path .join (input_path , pattern ))
0 commit comments