Exemplo n.º 1
0
from buildlib import preprocess, buildshape, config
#from buildlib.buildpatch_mosse import build_patches
from buildlib.buildpatch import build_patches
from buildlib.buildscore import getScoring

buildPatches = True
buildScoring = True
cleanUp = True

# create some needed folders
for folder in ["cropped", "pcropped", "svmImages"]:
	if not os.path.exists(os.path.join(config.data_folder, folder)):
		os.makedirs(os.path.join(config.data_folder, folder))

# preprocess data
data_pca, data_patches, meanshape, cropsize = preprocess.preprocess(config.annotations, mirror = True)

#dp = {'data_pca' : data_pca, 'data_patches' : data_patches, 'meanshape' : meanshape, 'cropsize' : cropsize}
#fi = open("out.data", "w")
#pickle.dump(dp, fi)
#fi.close()

#fi = open("out.data", "r")
#data = pickle.load(fi)
#fi.close()
#data_pca = data['data_pca']
#data_patches = data['data_patches']
#meanshape = data['meanshape']
#cropsize = data['cropsize']

# build shape model
Exemplo n.º 2
0
from buildlib import preprocess, buildshape, config
#from buildlib.buildpatch_mosse import build_patches
from buildlib.buildpatch import build_patches
from buildlib.buildscore import getScoring

buildPatches = True
buildScoring = True
cleanUp = True

# create some needed folders
for folder in ["cropped", "pcropped", "svmImages"]:
    if not os.path.exists(os.path.join(config.data_folder, folder)):
        os.makedirs(os.path.join(config.data_folder, folder))

# preprocess data
data_pca, data_patches, meanshape, cropsize = preprocess.preprocess(
    config.annotations, mirror=True)

#dp = {'data_pca' : data_pca, 'data_patches' : data_patches, 'meanshape' : meanshape, 'cropsize' : cropsize}
#fi = open("out.data", "w")
#pickle.dump(dp, fi)
#fi.close()

#fi = open("out.data", "r")
#data = pickle.load(fi)
#fi.close()
#data_pca = data['data_pca']
#data_patches = data['data_patches']
#meanshape = data['meanshape']
#cropsize = data['cropsize']

# build shape model