I am trying to see if i can use Dask for blockwise parallelization of the detection and segmentation of objects in massive 2D images (~20-50 GB) on a cluster.
My logic to detect/segment objects in an image block will be encapsulated in a function.
I came across a Dask function called map_blocks that lets me apply a custom function on each block/chunk of a dask array.
However, i see that the output type of the function i can pass to map_blocks should also be an array.
For object detection/segmentation, i would want my function to be able to return the coordinates of the bounding contour of each object found/detected in the block. Note that the number of objects in any block is unknown and depends on the image.
How can i solve this use case with map_blocks or something else in Dask?