If your contours have a static number of points you could try to fit your model to a regression task where the outputs would be these contour points.
I don’t know what the best approach would be for a variable number of contour points. Maybe a recurrent architecture could work in this case.