Ejemplo n.º 1
0
def renderer_only():
    renderer = Renderer()
    renderer.set_energy_terms(Optimizer.energy_dic.keys())
    renderer.set_penalty_terms(['penalty'])
    from PIL import Image
    renderer.set_target_image(Image.open("..\\img\\target_mickey.png").convert('L'))
    renderer.start()
    renderer.wait_till_init()
    return renderer
Ejemplo n.º 2
0
def all_single_energy_combos():
    renderer = Renderer()
    renderer.start()
    renderer.wait_till_init()
    x_0 = renderer.get_param()
    for method_name, energy_name in product(Optimizer.method_dic, Optimizer.energy_dic):
        print method_name, energy_name
        renderer.set_param(x_0)
        optimizer = Optimizer(None)
        plotting.attach_plotter(optimizer, plotting.Plotter(*get_fname("..\\res")))
        optimizer.set_target("C:\\Users\\cxz\\Pictures\\target.png")
        optimizer.set_method(method_name)
        optimizer.set_energy([energy_name], [1])
        optimizer.run()
Ejemplo n.º 3
0
def get_renderer():
    renderer = Renderer()
    renderer.start()
    renderer.wait_till_init()
    return renderer