Skip to content
Advertisement

How do I crop an image based on custom mask

I start my model and get a mask prediction of the area I would like to crop.

JavaScript

enter image description here

This code is the closest I have gotten to the desired image, the problem with this image that is provided is that it doesn’t crop out black background

JavaScript

enter image description here

My desired image should be like this enter image description here

Advertisement

Answer

You could try this:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement