When running calc_gt_coco.py using the RLE format, the biggest bottleneck is the binary_mask_to_rle function.
Replacing the explicit python loop with pure numpy, reduces the execution time of the function from 70ms to 1ms. Especially when having many objects/masks this leads to a significant speed up of calc_gt_coco.
When running
calc_gt_coco.py
using the RLE format, the biggest bottleneck is the binary_mask_to_rle function. Replacing the explicit python loop with pure numpy, reduces the execution time of the function from 70ms to 1ms. Especially when having many objects/masks this leads to a significant speed up of calc_gt_coco.