Hello @ptrblck,
Please I am facing the same problem, I have 5 points that are produced from simple NN and I want to get the area inside them to generate a mask to be able to apply a segmentation loss on the mask.
I implemented it using cv2.fillploy after converting the 5 points to numpy but unfortunately, I lost the gradients.
I thought about your comment to use grid_sample but unfortunately, I don’t know how could I generate the mask with respect to the 5 points without losing the gradient tracing
My main problem is that, I don’t have the all desired position to create my grid, and If I use fillpoly to get the positions then I will loss the gradient trace.
And suggestions?