MIC-DKFZ / nnUNet

Apache License 2.0
5.95k stars 1.77k forks source link

Fast inference for large files with several classes #2540 #2545

Open pooya-mohammadi opened 1 month ago

pooya-mohammadi commented 1 month ago

When doing inference on large files with large number of classes the following code section blocks the code for up too 600 seconds:

            for c in range(data.shape[0]):
                reshaped_final[c] = resize_fn(data[c], new_shape, order, **kwargs)

in preprocessing.resampling.default_resampling.py and func: resample_data_or_seg. If someone does not need the probabilities they can skip this section by only sending the segmentation array which is very fast.

Solving issue #2540

pooya-mohammadi commented 1 month ago

Or the depicted code snippet can be done in a multiprocessing manner.