Ejemplo n.º 1
0
def run():

    files = next(os.walk(OUTPUT))[2]
    asm = ASMB([0,1],100)
    allLines = []
    pts = []
    for f in files:
        with open( os.path.join( OUTPUT, f), "r" ) as infile:
        
            allLines = infile.readlines()
            if len(allLines) > 0:
                cleanLines = [ x.strip().split('\t') for x in allLines]
                ptList = [ Point( x[0], x[1]) for x in cleanLines ]
                asm.addShape( Shape( ptList ) )
    asm.iterateAlignment()
Ejemplo n.º 2
0
def run():

    files = next(os.walk(OUTPUT))[2]
    asm = ASMB([0, 1], 100)
    allLines = []
    pts = []
    for f in files:
        with open(os.path.join(OUTPUT, f), "r") as infile:

            allLines = infile.readlines()
            if len(allLines) > 0:
                cleanLines = [x.strip().split('\t') for x in allLines]
                ptList = [Point(x[0], x[1]) for x in cleanLines]
                asm.addShape(Shape(ptList))
    asm.iterateAlignment()
#from pathos.multiprocessing import ProcessingPool as Pool
#import pathos.multiprocessing as mp

from pathos.multiprocessing import ProcessPool as Pool
from ActiveShapeModelsBetter import ASMB, Point, Shape
import dill

if __name__ == "__main__":
    asm = ASMB([0, 1], 10)
    asm.addShape(Shape([Point(100, 200), Point(200, 440), Point(400, 300)]))
    p = Pool()
    p.map(Point.rotate, asm.allShapes, [[-1, 1], [1, -1]])
# from pathos.multiprocessing import ProcessingPool as Pool
# import pathos.multiprocessing as mp

from pathos.multiprocessing import ProcessPool as Pool
from ActiveShapeModelsBetter import ASMB, Point, Shape
import dill


if __name__ == "__main__":
    asm = ASMB([0, 1], 10)
    asm.addShape(Shape([Point(100, 200), Point(200, 440), Point(400, 300)]))
    p = Pool()
    p.map(Point.rotate, asm.allShapes, [[-1, 1], [1, -1]])