How to clean edges of Mask


I have a image and i need to create mask for every person

  • List item
    have used resnet50 to extract mask for every person in the original image

  • List item

For every mask i create a image

However, the edges of the mask needs to be filtered with proper algorithm. Refer the attached mask image