def unitRectCallback(population):
    if random.random() < 0.05:
        return
    im = pv.Image(np.zeros((1000,1000),dtype=np.float32))
    for each in population:
        rect = each[1][0].generate()
        im.annotateRect(1000*rect,color='gray')
    rect = population[0][1][0].generate()
    im.annotatePolygon((1000*rect).asPolygon(),color='green',width=3)
    target_rect = pv.CenteredRect(.33385,.69348,.3482,.55283)
    im.annotatePolygon((1000*target_rect).asPolygon(),color='white',width=3)
    #im.show(delay=1)
dataset/ETHPy150Open bolme/pyvision/src/pyvision/optimize/testsuite.py/unitRectCallback/original