These are chat archives for menpo/menpo

8th
Aug 2014
Joan Alabort-i-Medina
@jalabort
Aug 08 2014 14:28
from menpo.fitmultilevel.aam import AAMBuilder
from menpo.image import MaskedImage
from menpo.image.feature.features import hog_cuda

def my_hogs(image):    
    hog_pixels = hog_cuda(image.pixels, mode='dense')
    hog_img = MaskedImage(hog_pixels, copy=False)
    hog_img.landmarks = image.landmarks
    return hog_img

# build AAM
aam = AAMBuilder(feature_type=my_hogs, normalization_diagonal=100, n_levels=1).build(training_images, verbose=True)
from menpo.fitmultilevel.aam import LucasKanadeAAMFitter

# define Lucas-Kanade based AAM fitter
fitter = LucasKanadeAAMFitter(aam, n_shape=0.9, n_appearance=0.9)