Clarification on Sliding Window Inference #5701
-
Hello everybody!
For the experiment I chose
notice: the value of the preds in the third image is Basically with My doubt arises from the fact that when
so, in the batch there are not windows from different images, but rather subsequent windows from the same input. I can see that this reasoning can be generalized to the one I made before, where the subwindows match exactly the original input and the batches become "traditional batches". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @sh3rlock14, when we use Lines 147 to 149 in 4f584a9 Hope it can help you, thanks! |
Beta Was this translation helpful? Give feedback.
Hi @sh3rlock14, when we use
SlidingWindowInferer
, we mainly consider when the original data is too large and the memory is not enough, at this time we can randomly crop during training and predict by sliding window during inference.For
sw_batch_size
, you can simply treat it as batch dimension during inference, the total num of windows iswindows_num_per_image * batch_size
. Additionally, if yourroi_size
is equal toinput_size
you can useSimpleInferer
directly instead ofSlidingWindowInferer
. For theoverlap
arg, it is mainly to ensure more accurate results of the boundary when doing sliding windows.MONAI/monai/inferers/utils.py
Lines 147 to 149 in 4f584a9