Exemplo n.º 1
0
import os.path
from cvpr_build_models_frgc import build_all_models_frgc
from sfs_io import load_frgc

celebrities_path = '/home/pts08/research/sfs/celebrities'
#celebrity_subjects = ['clint_eastwood', 'gerard_depardieu', 'jack_nicholson',
#                      'jude_law', 'mona_lisa', 'samuel_beckett', 'tom_cruise',
#                      'tom_hanks']
# 'jude_law' is too big an image
celebrity_subjects = ['mona_lisa', 'samuel_beckett', 'tom_cruise', 'tom_hanks']

print "Loading FRGC"
images = load_frgc('spring2003')

for subject in celebrity_subjects:
    base_path = os.path.join(celebrities_path, subject + '.png')
    build_all_models_frgc(images, base_path, subject)
Exemplo n.º 2
0
    sys.stdout.flush()


# <markdowncell>

# ## Load all the aligned shapes from the dataset

# <codecell>

RECREATE_MESHES = False

# <codecell>

from sfs_io import load_frgc

images = load_frgc('spring2003', RECREATE_MESHES)

# <codecell>


def extract_normals(images):
    vector_shape = images[0].mesh.vertex_normals.shape
    N = len(images)
    normals = np.zeros([N, vector_shape[0], vector_shape[1]])
    for i, im in enumerate(images):
        normals[i, ...] = im.mesh.vertex_normals
    return normals


# <codecell>
    sys.stdout.write('\r' + string)
    sys.stdout.flush()

# <markdowncell>

# ## Load all the aligned shapes from the dataset

# <codecell>

RECREATE_MESHES = False

# <codecell>

from sfs_io import load_frgc

images = load_frgc('spring2003', RECREATE_MESHES)

# <codecell>

def extract_normals(images):
    vector_shape = images[0].mesh.vertex_normals.shape
    N = len(images)
    normals = np.zeros([N, vector_shape[0], vector_shape[1]])
    for i, im in enumerate(images):
        normals[i, ...] = im.mesh.vertex_normals
    return normals

# <codecell>

def create_feature_space(feature_matrix, example_image, feature_space_name):
    feature_space_images = []
import os.path
from cvpr_build_models_frgc import build_all_models_frgc
from sfs_io import load_frgc


celebrities_path = '/home/pts08/research/sfs/celebrities'
#celebrity_subjects = ['clint_eastwood', 'gerard_depardieu', 'jack_nicholson',
#                      'jude_law', 'mona_lisa', 'samuel_beckett', 'tom_cruise',
#                      'tom_hanks']
# 'jude_law' is too big an image
celebrity_subjects = ['mona_lisa', 'samuel_beckett', 'tom_cruise',
                      'tom_hanks']


print "Loading FRGC"
images = load_frgc('spring2003')

for subject in celebrity_subjects:
    base_path = os.path.join(celebrities_path, subject + '.png')
    build_all_models_frgc(images, base_path, subject)