Memory utilization is high when constructing segmentations of large images (e.g. WSIs).
This is one simple two-line refactor to reduce memory consumption that I spotted: the current code creates a copy of all non-zero pixels the input array cast to uint16 (which may be double the input array size) just to find the list of unique segments.
Haven't actually evaluated the effect on memory usage (this may not be the limiting factor) but it's so obviously unnecessary that I just fixed it anyway.
Memory utilization is high when constructing segmentations of large images (e.g. WSIs).
This is one simple two-line refactor to reduce memory consumption that I spotted: the current code creates a copy of all non-zero pixels the input array cast to uint16 (which may be double the input array size) just to find the list of unique segments.
Haven't actually evaluated the effect on memory usage (this may not be the limiting factor) but it's so obviously unnecessary that I just fixed it anyway.