Mercurial > code > home > repos > light9
diff bin/paintserver @ 1570:0480fc790527
paint now looks for best match
Ignore-this: 5604a2a2181624a0612dddf1afa32985
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 27 May 2017 12:22:28 +0000 |
parents | a30a73c12554 |
children | 0d2247ec8f49 |
line wrap: on
line diff
--- a/bin/paintserver Thu May 25 07:01:42 2017 +0000 +++ b/bin/paintserver Sat May 27 12:22:28 2017 +0000 @@ -14,6 +14,7 @@ from light9.rdfdb import clientsession import light9.paint.solve from lib.cycloneerr import PrettyErrorHandler +from light9.namespaces import RDF, L9, DEV class Solve(PrettyErrorHandler, cyclone.web.RequestHandler): @@ -23,9 +24,18 @@ solver = light9.paint.solve.Solver(self.settings.graph) solver.loadSamples() with self.settings.stats.solve.time(): - out = solver.solve(painting) - layers = solver.simulationLayers(out) - self.write(json.dumps({'layers': layers, 'out': out})) + img = solver.draw(painting) + sample = solver.bestMatch(img) + with self.settings.graph.currentState() as g: + bestPath = 'show/dance2017/cam/test/%s' % g.value(sample, L9['path']) + #out = solver.solve(painting) + #layers = solver.simulationLayers(out) + + self.write(json.dumps({ + 'bestMatch': {'uri': sample, 'path': bestPath}, + # 'layers': layers, + # 'out': out, + })) class App(object): def __init__(self, show, session):