def show_labeling(im, labels):
 imshow(im)
 contour(labels, [(-0.5), 0.5])
 contourf(labels, [(-1), (-0.5)], colors='b', alpha=0.25)
 contourf(labels, [0.5, 1], colors='r', alpha=0.25)
 xticks([])
 yticks([])

def show_labeling ( im , labels ) : imshow ( im ) contour ( labels , [ ( - 0.5 ) , 0.5 ] ) contourf ( labels , [ ( - 1 ) , ( - 0.5 ) ] , colors = 'b' , alpha = 0.25 ) contourf ( labels , [ 0.5 , 1 ] , colors = 'r' , alpha = 0.25 ) xticks ( [ ] ) yticks ( [ ] )
show image with foreground and background areas .