I want to extract the mask and turn it into a new loss function that i want to experiment on. Without detaching the predicted images, or using openCV to estimate the mask of the output images. What can i do to get the mask of the foreground from the background?