How to separate external and internal contour

Hello, you will need to use contours_hierarchy

filling can be done like this:

cv2.fillPoly(img, pts =[contours], color=(255,255,255))