davisinteractive.utils.mask
combine_masks
combine_masks(masks, th=0.5, method='max_per_pixel')
Different methods are the following:
max_per_pixel
: Computes the final mask taking the pixel with the highest probability for every object.
Arguments
- masks: List. Containing a list of masks for every object.
Therefore,
len(masks) == number_objects
andlen(masks[0]) == number_frames
. The masks should be Numpy Array. - th: Float. Threshold to binarize the masks.
- method: String. Method that specifies how the masks are fused.
Returns
list
: Returns a list with all the results of the masks fused.