def get_frames(self):
     sheet = pg.image.load("p1_walk.png").convert()
     sheet.set_colorkey(c.SPRITESHEET_BACKGROUND)
     return tools.get_images(sheet, self.rect.size)
Beispiel #2
0
 def get_frames(self):
     sheet = pg.image.load("p1_walk.png").convert()
     sheet.set_colorkey(c.SPRITESHEET_BACKGROUND)
     return tools.get_images(sheet, self.rect.size)
Beispiel #3
0
t0 = time.time()        # count execution-time for whole programm
localtime = time.asctime( time.localtime(time.time()) )
print "Local current time :", localtime
logging.info('Current Log-Level: %s' % logging.getLevelName(logging.getLogger('myLogger').root.getEffectiveLevel()))

if parameter.train == 1:
    #start train
    ##############################################
    print 'TRAINING STARTED'

    # foldername containing the training images
    trainfolder = "train"                               

    # make list with all images in the folder
    image_filenames = tools.get_images(trainfolder)

    # detect faces and features in images
    trained_data = train.get_face_data(image_filenames)
    
    if parameter.pickle_data == 1:
        # safe (pickle) data
        persistence.safe_data(trained_data)
        print time.time() - t0, "seconds" # print execution-time for Training
        
    print 'TRAINING FINISHED'
   
    #optional evaluation
    ###############################################

    # show training-images and paint keypoints into the pictures