Repository navigation
Replies: 1 comment
|
There is no multi-threading option for the merge step. For segmentation, the merge does a polygon union for each merged pair in one Python loop, but you can avoid most of that cost and the other large costs with parameters. I checked SAHI 0.14.1 (current). Many parts of this got faster after the 0.11.x releases from early 2025, so upgrade first: Start by measuring where the time goes. With Settings that usually help most: from sahi.predict import get_sliced_prediction
result = get_sliced_prediction(
image,
detection_model,
slice_height=512,
slice_width=512,
overlap_height_ratio=0.2,
overlap_width_ratio=0.2,
perform_standard_pred=False, # default True
batch_size=16, # added in 0.12.0, default 1
postprocess_type="NMS", # default "GREEDYNMM"
verbose=2,
)Why each one helps (all in
Two more things that reduce the number of predictions, and thus the merge work:
If you must keep |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm currently working on a project using SAHI for large image segmentation (10000 x 10000 pixels) with 512 x 512 pixel patches using the get_sliced_prediction function. We've encountered a significant performance bottleneck where the processing is taking several days to complete. Our observations suggest that the merging process might not be utilizing multi-threading capabilities.
Current setup:
Issues:
Could you please:
Any guidance on improving the performance would be greatly appreciated. Thank you for your time and support!
All reactions