├── CODEOWNERS
├── LICENCE.txt
├── README.md
├── crop_training_set.py
├── data_loading_functions.py
├── deep_heatmaps_model_fusion_net.py
├── deformation_functions.py
├── logging_functions.py
├── menpo_functions.py
├── menpofit
├── __init__.py
├── _version.py
├── aam
│ ├── __init__.py
│ ├── algorithm
│ │ ├── __init__.py
│ │ ├── lk.py
│ │ └── sd.py
│ ├── base.py
│ ├── fitter.py
│ ├── pretrained.py
│ └── result.py
├── aps
│ ├── __init__.py
│ ├── algorithm
│ │ ├── __init__.py
│ │ └── gn.py
│ ├── base.py
│ ├── fitter.py
│ └── result.py
├── atm
│ ├── __init__.py
│ ├── algorithm.py
│ ├── base.py
│ └── fitter.py
├── base.py
├── builder.py
├── checks.py
├── clm
│ ├── __init__.py
│ ├── algorithm
│ │ ├── __init__.py
│ │ └── gd.py
│ ├── base.py
│ ├── expert
│ │ ├── __init__.py
│ │ ├── base.py
│ │ └── ensemble.py
│ └── fitter.py
├── compatibility.py
├── differentiable.py
├── dlib
│ ├── __init__.py
│ ├── algorithm.py
│ ├── conversion.py
│ └── fitter.py
├── error
│ ├── __init__.py
│ ├── base.py
│ ├── human
│ │ ├── __init__.py
│ │ └── face.py
│ └── stats.py
├── fitter.py
├── io.py
├── lk
│ ├── __init__.py
│ ├── algorithm.py
│ ├── fitter.py
│ ├── residual.py
│ └── result.py
├── math
│ ├── __init__.py
│ ├── correlationfilter.py
│ ├── fft_utils.py
│ └── regression.py
├── modelinstance.py
├── result.py
├── sdm
│ ├── __init__.py
│ ├── algorithm
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── fullyparametric.py
│ │ ├── nonparametric.py
│ │ ├── parametricappearance.py
│ │ └── parametricshape.py
│ └── fitter.py
├── transform
│ ├── __init__.py
│ ├── homogeneous.py
│ ├── modeldriven.py
│ ├── piecewiseaffine.py
│ ├── rbf.py
│ ├── test
│ │ ├── __init__.py
│ │ ├── h_affine_test.py
│ │ ├── homogeneous_test.py
│ │ ├── rbf_test.py
│ │ └── tps_test.py
│ └── thinsplatesplines.py
└── visualize
│ ├── __init__.py
│ ├── base.py
│ └── textutils.py
├── old
├── create_artistic_data_in_advance.ipynb
├── deep_heatmaps_model_ect.py
├── deep_heatmaps_model_primary.py
├── eval_scripts
│ ├── evaluate_and_compare_multiple_models.py
│ ├── evaluate_model.py
│ ├── evaluate_models.py
│ └── evaluation_functions.py
├── image_utils.py
├── load_data_module.ipynb
├── main.py
├── main_fusion.py
├── main_fusion_server.py
├── main_primary_server.py
├── run_tests_template.py
├── teaser.png
└── temp
│ ├── Untitled.rtf
│ ├── create_art_data.py
│ ├── create_art_data_functions.py
│ ├── deep_heatmaps_model_primary_net.py
│ ├── main_primary.py
│ ├── predict_landmarks.py
│ ├── run_tests_fusion.py
│ └── run_tests_primary.py
├── ops.py
├── pdm_clm_functions.py
├── pdm_clm_models
├── clm_models
│ ├── basic_all
│ ├── basic_jaw
│ ├── basic_l_brow
│ ├── basic_l_eye
│ ├── basic_mouth
│ ├── basic_nose
│ ├── basic_r_brow
│ ├── basic_r_eye
│ ├── g_t_all
│ ├── g_t_jaw
│ ├── g_t_l_brow
│ ├── g_t_l_eye
│ ├── g_t_mouth
│ ├── g_t_nose
│ ├── g_t_r_brow
│ └── g_t_r_eye
└── pdm_models
│ ├── basic_all_30
│ ├── basic_jaw_10
│ ├── basic_jaw_16
│ ├── basic_jaw_20
│ ├── basic_jaw_5
│ ├── basic_jaw_7
│ ├── basic_l_brow_2
│ ├── basic_l_brow_3
│ ├── basic_l_brow_4
│ ├── basic_l_brow_5
│ ├── basic_l_brow_6
│ ├── basic_l_eye_2
│ ├── basic_l_eye_3
│ ├── basic_l_eye_4
│ ├── basic_l_eye_6
│ ├── basic_l_eye_8
│ ├── basic_mouth_10
│ ├── basic_mouth_20
│ ├── basic_mouth_25
│ ├── basic_mouth_5
│ ├── basic_mouth_7
│ ├── basic_nose_14
│ ├── basic_nose_3
│ ├── basic_nose_5
│ ├── basic_nose_7
│ ├── basic_nose_9
│ ├── basic_r_brow_2
│ ├── basic_r_brow_3
│ ├── basic_r_brow_4
│ ├── basic_r_brow_5
│ ├── basic_r_brow_6
│ ├── basic_r_eye_2
│ ├── basic_r_eye_3
│ ├── basic_r_eye_4
│ ├── basic_r_eye_6
│ ├── basic_r_eye_8
│ ├── g_t_all_30
│ ├── g_t_jaw_10
│ ├── g_t_jaw_16
│ ├── g_t_jaw_20
│ ├── g_t_jaw_5
│ ├── g_t_jaw_7
│ ├── g_t_l_brow_2
│ ├── g_t_l_brow_3
│ ├── g_t_l_brow_4
│ ├── g_t_l_brow_5
│ ├── g_t_l_brow_6
│ ├── g_t_l_eye_2
│ ├── g_t_l_eye_3
│ ├── g_t_l_eye_4
│ ├── g_t_l_eye_6
│ ├── g_t_l_eye_8
│ ├── g_t_mouth_10
│ ├── g_t_mouth_20
│ ├── g_t_mouth_25
│ ├── g_t_mouth_5
│ ├── g_t_mouth_7
│ ├── g_t_nose_14
│ ├── g_t_nose_3
│ ├── g_t_nose_5
│ ├── g_t_nose_7
│ ├── g_t_nose_9
│ ├── g_t_r_brow_2
│ ├── g_t_r_brow_3
│ ├── g_t_r_brow_4
│ ├── g_t_r_brow_5
│ ├── g_t_r_brow_6
│ ├── g_t_r_eye_2
│ ├── g_t_r_eye_3
│ ├── g_t_r_eye_4
│ ├── g_t_r_eye_6
│ └── g_t_r_eye_8
├── predict_landmarks.py
├── requirements.txt
├── rspimage.py
└── train_heatmaps_network.py
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @papulke
2 |
--------------------------------------------------------------------------------
/LICENCE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Jordan Yaniv
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
21 | OR OTHER DEALINGS IN THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # The Face of Art: Landmark Detection and Geometric Style in Portraits
2 |
3 | Code for the landmark detection framework described in [The Face of Art: Landmark Detection and Geometric Style in Portraits](http://www.faculty.idc.ac.il/arik/site/foa/face-of-art.asp) (SIGGRAPH 2019)
4 |
5 | 
6 | Top: landmark detection results on artistic portraits with different styles allows to define the geometric style of an artist. Bottom: results of the style transfer of portraits using various artists' geometric style, including Amedeo Modigliani, Pablo Picasso, Margaret Keane, Fernand Léger, and Tsuguharu Foujita. Top right portrait is from 'Woman with Peanuts,' ©1962, Estate of Roy Lichtenstein.
7 |
8 | ## Getting Started
9 |
10 | ### Requirements
11 |
12 | * python
13 | * anaconda
14 |
15 | ### Download
16 |
17 | #### Model
18 | download model weights from [here](https://www.dropbox.com/sh/hrxcyug1bmbj6cs/AAAxq_zI5eawcLjM8zvUwaXha?dl=0).
19 |
20 | #### Datasets
21 | * The datasets used for training and evaluating our model can be found [here](https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/).
22 |
23 | * The Artistic-Faces dataset can be found [here](http://www.faculty.idc.ac.il/arik/site/foa/artistic-faces-dataset.asp).
24 |
25 | * Training images with texture augmentation can be found [here](https://www.dropbox.com/sh/av2k1i1082z0nie/AAC5qV1E2UkqpDLVsv7TazMta?dl=0).
26 | before applying texture style transfer, the training images were cropped to the ground-truth face bounding-box with 25% margin. To crop training images, run the script `crop_training_set.py`.
27 |
28 | * our model expects the following directory structure of landmark detection datasets:
29 | ```
30 | landmark_detection_datasets
31 | ├── training
32 | ├── test
33 | ├── challenging
34 | ├── common
35 | ├── full
36 | ├── crop_gt_margin_0.25 (cropped images of training set)
37 | └── crop_gt_margin_0.25_ns (cropped images of training set + texture style transfer)
38 | ```
39 | ### Install
40 |
41 | Create a virtual environment and install the following:
42 | * opencv
43 | * menpo
44 | * menpofit
45 | * tensorflow-gpu
46 |
47 | for python 2:
48 | ```
49 | conda create -n foa_env python=2.7 anaconda
50 | source activate foa_env
51 | conda install -c menpo opencv
52 | conda install -c menpo menpo
53 | conda install -c menpo menpofit
54 | pip install tensorflow-gpu
55 |
56 | ```
57 |
58 | for python 3:
59 | ```
60 | conda create -n foa_env python=3.5 anaconda
61 | source activate foa_env
62 | conda install -c menpo opencv
63 | conda install -c menpo menpo
64 | conda install -c menpo menpofit
65 | pip3 install tensorflow-gpu
66 |
67 | ```
68 |
69 | Clone repository:
70 |
71 | ```
72 | git clone https://github.com/papulke/deep_face_heatmaps
73 | ```
74 |
75 | ## Instructions
76 |
77 | ### Training
78 |
79 | To train the network you need to run `train_heatmaps_network.py`
80 |
81 | example for training a model with texture augmentation (100% of images) and geometric augmentation (~70% of images):
82 | ```
83 | python train_heatmaps_network.py --output_dir='test_artistic_aug' --augment_geom=True \
84 | --augment_texture=True --p_texture=1. --p_geom=0.7
85 | ```
86 |
87 | ### Testing
88 |
89 | For using the detection framework to predict landmarks, run the script `predict_landmarks.py`
90 |
91 | ## Acknowledgments
92 |
93 | * [ect](https://github.com/HongwenZhang/ECT-FaceAlignment)
94 | * [menpo](https://github.com/menpo/menpo)
95 | * [menpofit](https://github.com/menpo/menpofit)
96 | * [mdm](https://github.com/trigeorgis/mdm)
97 | * [style transfer implementation](https://github.com/woodrush/neural-art-tf)
98 | * [painter-by-numbers dataset](https://www.kaggle.com/c/painter-by-numbers/data)
99 |
--------------------------------------------------------------------------------
/crop_training_set.py:
--------------------------------------------------------------------------------
1 | from scipy.misc import imsave
2 | from menpo_functions import *
3 | from data_loading_functions import *
4 |
5 |
6 | # define paths & parameters for cropping dataset
7 | img_dir = '~/landmark_detection_datasets/'
8 | dataset = 'training'
9 | bb_type = 'gt'
10 | margin = 0.25
11 | image_size = 256
12 |
13 | # load bounding boxes
14 | bb_dir = os.path.join(img_dir, 'Bounding_Boxes')
15 | bb_dictionary = load_bb_dictionary(bb_dir, mode='TRAIN', test_data=dataset)
16 |
17 | # directory for saving face crops
18 | outdir = os.path.join(img_dir, 'crop_'+bb_type+'_margin_'+str(margin))
19 | if not os.path.exists(outdir):
20 | os.mkdir(outdir)
21 |
22 | # load images
23 | imgs_to_crop = load_menpo_image_list(
24 | img_dir=img_dir, train_crop_dir=None, img_dir_ns=None, mode='TRAIN', bb_dictionary=bb_dictionary,
25 | image_size=image_size, margin=margin, bb_type=bb_type, augment_basic=False)
26 |
27 | # save cropped images with matching landmarks
28 | print ("\ncropping dataset from: "+os.path.join(img_dir, dataset))
29 | print ("\nsaving cropped dataset to: "+outdir)
30 | for im in imgs_to_crop:
31 | if im.pixels.shape[0] == 1:
32 | im_pixels = gray2rgb(np.squeeze(im.pixels))
33 | else:
34 | im_pixels = np.rollaxis(im.pixels, 0, 3)
35 | imsave(os.path.join(outdir, im.path.name.split('.')[0]+'.png'), im_pixels)
36 | mio.export_landmark_file(im.landmarks['PTS'], os.path.join(outdir, im.path.name.split('.')[0]+'.pts'))
37 |
38 | print ("\ncropping dataset completed!")
39 |
--------------------------------------------------------------------------------
/data_loading_functions.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import os
3 | from skimage.color import gray2rgb
4 |
5 |
6 | def train_val_shuffle_inds_per_epoch(valid_inds, train_inds, train_iter, batch_size, log_path, save_log=True):
7 | """shuffle image indices for each training epoch and save to log"""
8 |
9 | np.random.seed(0)
10 | num_train_images = len(train_inds)
11 | num_epochs = int(np.ceil((1. * train_iter) / (1. * num_train_images / batch_size)))+1
12 | epoch_inds_shuffle = np.zeros((num_epochs, num_train_images)).astype(int)
13 | img_inds = np.arange(num_train_images)
14 | for i in range(num_epochs):
15 | np.random.shuffle(img_inds)
16 | epoch_inds_shuffle[i, :] = img_inds
17 |
18 | if save_log:
19 | with open(os.path.join(log_path, "train_val_shuffle_inds.csv"), "wb") as f:
20 | if valid_inds is not None:
21 | f.write(b'valid inds\n')
22 | np.savetxt(f, valid_inds.reshape(1, -1), fmt='%i', delimiter=",")
23 | f.write(b'train inds\n')
24 | np.savetxt(f, train_inds.reshape(1, -1), fmt='%i', delimiter=",")
25 | f.write(b'shuffle inds\n')
26 | np.savetxt(f, epoch_inds_shuffle, fmt='%i', delimiter=",")
27 |
28 | return epoch_inds_shuffle
29 |
30 |
31 | def gaussian(x, y, x0, y0, sigma=6):
32 | return 1./(np.sqrt(2*np.pi)*sigma) * np.exp(-0.5 * ((x-x0)**2 + (y-y0)**2) / sigma**2)
33 |
34 |
35 | def create_gaussian_filter(sigma=6, win_mult=3.5):
36 | win_size = int(win_mult * sigma)
37 | x, y = np.mgrid[0:2*win_size+1, 0:2*win_size+1]
38 | gauss_filt = (8./3)*sigma*gaussian(x, y, win_size, win_size, sigma=sigma) # same as in ECT
39 | return gauss_filt
40 |
41 |
42 | def load_images(img_list, batch_inds, image_size=256, c_dim=3, scale=255):
43 |
44 | """ load images as a numpy array from menpo image list """
45 |
46 | num_inputs = len(batch_inds)
47 | batch_menpo_images = img_list[batch_inds]
48 |
49 | images = np.zeros([num_inputs, image_size, image_size, c_dim]).astype('float32')
50 |
51 | for ind, img in enumerate(batch_menpo_images):
52 | if img.n_channels < 3 and c_dim == 3:
53 | images[ind, :, :, :] = gray2rgb(img.pixels_with_channels_at_back())
54 | else:
55 | images[ind, :, :, :] = img.pixels_with_channels_at_back()
56 |
57 | if scale is 255:
58 | images *= 255
59 | elif scale is 0:
60 | images = 2 * images - 1
61 |
62 | return images
63 |
64 |
65 | # loading functions with pre-allocation and approx heat-map generation
66 |
67 |
68 | def create_approx_heat_maps_alloc_once(landmarks, maps, gauss_filt=None, win_mult=3.5, num_landmarks=68, image_size=256,
69 | sigma=6):
70 | """ create heatmaps from input landmarks"""
71 | maps.fill(0.)
72 |
73 | win_size = int(win_mult * sigma)
74 | filt_size = 2 * win_size + 1
75 | landmarks = landmarks.astype(int)
76 |
77 | if gauss_filt is None:
78 | x_small, y_small = np.mgrid[0:2 * win_size + 1, 0:2 * win_size + 1]
79 | gauss_filt = (8. / 3) * sigma * gaussian(x_small, y_small, win_size, win_size, sigma=sigma) # same as in ECT
80 |
81 | for i in range(num_landmarks):
82 |
83 | min_row = landmarks[i, 0] - win_size
84 | max_row = landmarks[i, 0] + win_size + 1
85 | min_col = landmarks[i, 1] - win_size
86 | max_col = landmarks[i, 1] + win_size + 1
87 |
88 | if min_row < 0:
89 | min_row_gap = -1 * min_row
90 | min_row = 0
91 | else:
92 | min_row_gap = 0
93 |
94 | if min_col < 0:
95 | min_col_gap = -1 * min_col
96 | min_col = 0
97 | else:
98 | min_col_gap = 0
99 |
100 | if max_row > image_size:
101 | max_row_gap = max_row - image_size
102 | max_row = image_size
103 | else:
104 | max_row_gap = 0
105 |
106 | if max_col > image_size:
107 | max_col_gap = max_col - image_size
108 | max_col = image_size
109 | else:
110 | max_col_gap = 0
111 |
112 | maps[min_row:max_row, min_col:max_col, i] =\
113 | gauss_filt[min_row_gap:filt_size - 1 * max_row_gap, min_col_gap:filt_size - 1 * max_col_gap]
114 |
115 |
116 | def load_images_landmarks_approx_maps_alloc_once(
117 | img_list, batch_inds, images, maps_small, maps, landmarks, image_size=256, num_landmarks=68,
118 | scale=255, gauss_filt_large=None, gauss_filt_small=None, win_mult=3.5, sigma=6, save_landmarks=False):
119 |
120 | """ load images and gt landmarks from menpo image list, and create matching heatmaps """
121 |
122 | batch_menpo_images = img_list[batch_inds]
123 | c_dim = images.shape[-1]
124 | grp_name = batch_menpo_images[0].landmarks.group_labels[0]
125 |
126 | win_size_large = int(win_mult * sigma)
127 | win_size_small = int(win_mult * (1.*sigma/4))
128 |
129 | if gauss_filt_small is None:
130 | x_small, y_small = np.mgrid[0:2 * win_size_small + 1, 0:2 * win_size_small + 1]
131 | gauss_filt_small = (8. / 3) * (1.*sigma/4) * gaussian(
132 | x_small, y_small, win_size_small, win_size_small, sigma=1.*sigma/4) # same as in ECT
133 | if gauss_filt_large is None:
134 | x_large, y_large = np.mgrid[0:2 * win_size_large + 1, 0:2 * win_size_large + 1]
135 | gauss_filt_large = (8. / 3) * sigma * gaussian(x_large, y_large, win_size_large, win_size_large, sigma=sigma) # same as in ECT
136 |
137 | for ind, img in enumerate(batch_menpo_images):
138 | if img.n_channels < 3 and c_dim == 3:
139 | images[ind, :, :, :] = gray2rgb(img.pixels_with_channels_at_back())
140 | else:
141 | images[ind, :, :, :] = img.pixels_with_channels_at_back()
142 |
143 | lms = img.landmarks[grp_name].points
144 | lms = np.minimum(lms, image_size - 1)
145 | create_approx_heat_maps_alloc_once(
146 | landmarks=lms, maps=maps[ind, :, :, :], gauss_filt=gauss_filt_large, win_mult=win_mult,
147 | num_landmarks=num_landmarks, image_size=image_size, sigma=sigma)
148 |
149 | lms_small = img.resize([image_size / 4, image_size / 4]).landmarks[grp_name].points
150 | lms_small = np.minimum(lms_small, image_size / 4 - 1)
151 | create_approx_heat_maps_alloc_once(
152 | landmarks=lms_small, maps=maps_small[ind, :, :, :], gauss_filt=gauss_filt_small, win_mult=win_mult,
153 | num_landmarks=num_landmarks, image_size=image_size / 4, sigma=1. * sigma / 4)
154 |
155 | if save_landmarks:
156 | landmarks[ind, :, :] = lms
157 |
158 | if scale is 255:
159 | images *= 255
160 | elif scale is 0:
161 | images = 2 * images - 1
162 |
--------------------------------------------------------------------------------
/menpofit/__init__.py:
--------------------------------------------------------------------------------
1 | from . import builder
2 | from . import differentiable
3 | from . import fitter
4 | from . import modelinstance
5 |
6 | from . import aam
7 | from . import atm
8 | from . import clm
9 | from . import dlib
10 | from . import lk
11 | from . import math
12 | from . import result
13 | from . import sdm
14 | from . import transform
15 | from . import visualize
16 |
17 |
18 | from ._version import get_versions
19 | __version__ = get_versions()['version']
20 | del get_versions
21 |
22 |
--------------------------------------------------------------------------------
/menpofit/aam/__init__.py:
--------------------------------------------------------------------------------
1 | from .base import HolisticAAM, LinearAAM, LinearMaskedAAM, PatchAAM, MaskedAAM
2 | from .fitter import (
3 | LucasKanadeAAMFitter,
4 | SupervisedDescentAAMFitter,
5 | holistic_sampling_from_scale, holistic_sampling_from_step)
6 | from .algorithm import (
7 | ProjectOutForwardCompositional, ProjectOutInverseCompositional,
8 | SimultaneousForwardCompositional, SimultaneousInverseCompositional,
9 | AlternatingForwardCompositional, AlternatingInverseCompositional,
10 | ModifiedAlternatingForwardCompositional,
11 | ModifiedAlternatingInverseCompositional,
12 | WibergForwardCompositional, WibergInverseCompositional,
13 | MeanTemplateNewton, MeanTemplateGaussNewton,
14 | ProjectOutNewton, ProjectOutGaussNewton,
15 | AppearanceWeightsNewton, AppearanceWeightsGaussNewton)
16 | from .pretrained import load_balanced_frontal_face_fitter
17 |
--------------------------------------------------------------------------------
/menpofit/aam/algorithm/__init__.py:
--------------------------------------------------------------------------------
1 | from .lk import (
2 | ProjectOutForwardCompositional, ProjectOutInverseCompositional,
3 | SimultaneousForwardCompositional, SimultaneousInverseCompositional,
4 | AlternatingForwardCompositional, AlternatingInverseCompositional,
5 | ModifiedAlternatingForwardCompositional,
6 | ModifiedAlternatingInverseCompositional,
7 | WibergForwardCompositional, WibergInverseCompositional)
8 | from .sd import (
9 | MeanTemplateNewton,
10 | MeanTemplateGaussNewton,
11 | ProjectOutNewton,
12 | ProjectOutGaussNewton,
13 | AppearanceWeightsNewton,
14 | AppearanceWeightsGaussNewton)
15 |
--------------------------------------------------------------------------------
/menpofit/aam/pretrained.py:
--------------------------------------------------------------------------------
1 | from menpofit.io import load_fitter
2 |
3 |
4 | def load_balanced_frontal_face_fitter():
5 | r"""
6 | Loads a frontal face patch-based AAM fitter that is a good compromise
7 | between model size, fitting time and fitting performance. The model returns
8 | 68 facial landmark points (the standard IBUG68 markup).
9 |
10 | Note that the first time you invoke this function, menpofit will
11 | download the fitter from Menpo's server. The fitter will then be stored
12 | locally for future use.
13 |
14 | The model is a :map:`PatchAAM` trained using the following parameters:
15 |
16 | =================== =================================
17 | Parameter Value
18 | =================== =================================
19 | `diagonal` 110
20 | `scales` (0.5, 1.0)
21 | `patch_shape` [(13, 13), (13, 13)]
22 | `holistic_features` `menpo.feature.fast_dsift()`
23 | `n_shape` [5, 20]
24 | `n_appearance` [30, 150]
25 | `lk_algorithm_cls` :map:`WibergInverseCompositional`
26 | =================== =================================
27 |
28 | It is also using the following `sampling` grid:
29 |
30 | .. code-block:: python
31 |
32 | import numpy as np
33 |
34 | patch_shape = (13, 13)
35 | sampling_step = 4
36 |
37 | sampling_grid = np.zeros(patch_shape, dtype=np.bool)
38 | sampling_grid[::sampling_step, ::sampling_step] = True
39 | sampling = [sampling_grid, sampling_grid]
40 |
41 | Additionally, it is trained on LFPW trainset, HELEN trainset, IBUG and AFW
42 | datasets (3283 images in total), which are hosted in
43 | http://ibug.doc.ic.ac.uk/resources/facial-point-annotations/.
44 |
45 | Returns
46 | -------
47 | fitter : :map:`LucasKanadeAAMFitter`
48 | A pre-trained :map:`LucasKanadeAAMFitter` based on a :map:`PatchAAM`
49 | that performs facial landmark localization returning 68 points (iBUG68).
50 | """
51 | return load_fitter('balanced_frontal_face_aam')
52 |
--------------------------------------------------------------------------------
/menpofit/aam/result.py:
--------------------------------------------------------------------------------
1 | from menpofit.result import (ParametricIterativeResult,
2 | MultiScaleParametricIterativeResult)
3 |
4 |
5 | class AAMAlgorithmResult(ParametricIterativeResult):
6 | r"""
7 | Class for storing the iterative result of an AAM optimisation algorithm.
8 |
9 | .. note:: When using a method with a parametric shape model, the first step
10 | is to **reconstruct the initial shape** using the shape model. The
11 | generated reconstructed shape is then used as initialisation for
12 | the iterative optimisation. This step is not counted in the number
13 | of iterations.
14 |
15 | Parameters
16 | ----------
17 | shapes : `list` of `menpo.shape.PointCloud`
18 | The `list` of shapes per iteration. The first and last members
19 | correspond to the initial and final shapes, respectively.
20 | shape_parameters : `list` of ``(n_shape_parameters,)`` `ndarray`
21 | The `list` of shape parameters per iteration. The first and last members
22 | correspond to the initial and final shapes, respectively.
23 | appearance_parameters : `list` of ``(n_appearance_parameters,)`` `ndarray`
24 | The `list` of appearance parameters per iteration. The first and last
25 | members correspond to the initial and final shapes, respectively.
26 | initial_shape : `menpo.shape.PointCloud` or ``None``, optional
27 | The initial shape from which the fitting process started. If
28 | ``None``, then no initial shape is assigned.
29 | image : `menpo.image.Image` or `subclass` or ``None``, optional
30 | The image on which the fitting process was applied. Note that a copy
31 | of the image will be assigned as an attribute. If ``None``, then no
32 | image is assigned.
33 | gt_shape : `menpo.shape.PointCloud` or ``None``, optional
34 | The ground truth shape associated with the image. If ``None``, then no
35 | ground truth shape is assigned.
36 | costs : `list` of `float` or ``None``, optional
37 | The `list` of cost per iteration. If ``None``, then it is assumed that
38 | the cost function cannot be computed for the specific algorithm.
39 | """
40 | def __init__(self, shapes, shape_parameters, appearance_parameters,
41 | initial_shape=None, image=None, gt_shape=None, costs=None):
42 | super(AAMAlgorithmResult, self).__init__(
43 | shapes=shapes, shape_parameters=shape_parameters,
44 | initial_shape=initial_shape, image=image, gt_shape=gt_shape,
45 | costs=costs)
46 | self._appearance_parameters = appearance_parameters
47 |
48 | @property
49 | def appearance_parameters(self):
50 | r"""
51 | Returns the `list` of appearance parameters obtained at each iteration
52 | of the fitting process. The `list` includes the parameters of the
53 | `initial_shape` (if it exists) and `final_shape`.
54 |
55 | :type: `list` of ``(n_params,)`` `ndarray`
56 | """
57 | return self._appearance_parameters
58 |
59 |
60 | class AAMResult(MultiScaleParametricIterativeResult):
61 | r"""
62 | Class for storing the multi-scale iterative fitting result of an AAM. It
63 | holds the shapes, shape parameters, appearance parameters and costs per
64 | iteration.
65 |
66 | .. note:: When using a method with a parametric shape model, the first step
67 | is to **reconstruct the initial shape** using the shape model. The
68 | generated reconstructed shape is then used as initialisation for
69 | the iterative optimisation. This step is not counted in the number
70 | of iterations.
71 |
72 | Parameters
73 | ----------
74 | results : `list` of :map:`AAMAlgorithmResult`
75 | The `list` of optimization results per scale.
76 | scales : `list` or `tuple`
77 | The `list` of scale values per scale (low to high).
78 | affine_transforms : `list` of `menpo.transform.Affine`
79 | The list of affine transforms per scale that transform the shapes into
80 | the original image space.
81 | scale_transforms : `list` of `menpo.shape.Scale`
82 | The list of scaling transforms per scale.
83 | image : `menpo.image.Image` or `subclass` or ``None``, optional
84 | The image on which the fitting process was applied. Note that a copy
85 | of the image will be assigned as an attribute. If ``None``, then no
86 | image is assigned.
87 | gt_shape : `menpo.shape.PointCloud` or ``None``, optional
88 | The ground truth shape associated with the image. If ``None``, then no
89 | ground truth shape is assigned.
90 | """
91 | def __init__(self, results, scales, affine_transforms, scale_transforms,
92 | image=None, gt_shape=None):
93 | super(AAMResult, self).__init__(
94 | results=results, scales=scales, affine_transforms=affine_transforms,
95 | scale_transforms=scale_transforms, image=image, gt_shape=gt_shape)
96 | # Create appearance parameters list
97 | self._appearance_parameters = None
98 | if results[0].appearance_parameters is not None:
99 | self._appearance_parameters = []
100 | for r in results:
101 | self._appearance_parameters += r.appearance_parameters
102 |
103 | @property
104 | def appearance_parameters(self):
105 | r"""
106 | Returns the `list` of appearance parameters obtained at each iteration
107 | of the fitting process. The `list` includes the parameters of the
108 | `initial_shape` (if it exists) and `final_shape`.
109 |
110 | :type: `list` of ``(n_params,)`` `ndarray`
111 | """
112 | return self._appearance_parameters
113 |
--------------------------------------------------------------------------------
/menpofit/aps/__init__.py:
--------------------------------------------------------------------------------
1 | from .base import GenerativeAPS
2 | from .fitter import GaussNewtonAPSFitter
3 | from .algorithm import Inverse, Forward
4 |
--------------------------------------------------------------------------------
/menpofit/aps/algorithm/__init__.py:
--------------------------------------------------------------------------------
1 | from .gn import Inverse, Forward
2 |
--------------------------------------------------------------------------------
/menpofit/atm/__init__.py:
--------------------------------------------------------------------------------
1 | from .base import HolisticATM, PatchATM, MaskedATM, LinearATM, LinearMaskedATM
2 | from .fitter import LucasKanadeATMFitter
3 | from .algorithm import ForwardCompositional, InverseCompositional
4 |
--------------------------------------------------------------------------------
/menpofit/atm/fitter.py:
--------------------------------------------------------------------------------
1 | from menpofit import checks
2 | from menpofit.fitter import MultiScaleParametricFitter
3 |
4 | from .algorithm import InverseCompositional
5 |
6 |
7 | class LucasKanadeATMFitter(MultiScaleParametricFitter):
8 | r"""
9 | Class for defining an ATM fitter using the Lucas-Kanade optimization.
10 |
11 | Parameters
12 | ----------
13 | atm : :map:`ATM` or `subclass`
14 | The trained ATM model.
15 | lk_algorithm_cls : `class`, optional
16 | The Lukas-Kanade optimisation algorithm that will get applied. The
17 | possible algorithms are:
18 |
19 | =========================== ============== =============
20 | Class Warp Direction Warp Update
21 | =========================== ============== =============
22 | :map:`ForwardCompositional` Forward Compositional
23 | :map:`InverseCompositional` Inverse
24 | =========================== ============== =============
25 |
26 | n_shape : `int` or `float` or `list` of those or ``None``, optional
27 | The number of shape components that will be used. If `int`, then it
28 | defines the exact number of active components. If `float`, then it
29 | defines the percentage of variance to keep. If `int` or `float`, then
30 | the provided value will be applied for all scales. If `list`, then it
31 | defines a value per scale. If ``None``, then all the available
32 | components will be used. Note that this simply sets the active
33 | components without trimming the unused ones. Also, the available
34 | components may have already been trimmed to `max_shape_components`
35 | during training.
36 | sampling : `list` of `int` or `ndarray` or ``None``
37 | It defines a sampling mask per scale. If `int`, then it defines the
38 | sub-sampling step of the sampling mask. If `ndarray`, then it
39 | explicitly defines the sampling mask. If ``None``, then no
40 | sub-sampling is applied.
41 | """
42 | def __init__(self, atm, lk_algorithm_cls=InverseCompositional,
43 | n_shape=None, sampling=None):
44 | # Store model
45 | self._model = atm
46 |
47 | # Check parameters
48 | checks.set_models_components(atm.shape_models, n_shape)
49 | self._sampling = checks.check_sampling(sampling, atm.n_scales)
50 |
51 | # Get list of algorithm objects per scale
52 | interfaces = atm.build_fitter_interfaces(self._sampling)
53 | algorithms = [lk_algorithm_cls(interface) for interface in interfaces]
54 |
55 | # Call superclass
56 | super(LucasKanadeATMFitter, self).__init__(
57 | scales=atm.scales, reference_shape=atm.reference_shape,
58 | holistic_features=atm.holistic_features, algorithms=algorithms)
59 |
60 | @property
61 | def atm(self):
62 | r"""
63 | The trained ATM model.
64 |
65 | :type: :map:`ATM` or `subclass`
66 | """
67 | return self._model
68 |
69 | def warped_images(self, image, shapes):
70 | r"""
71 | Given an input test image and a list of shapes, it warps the image
72 | into the shapes. This is useful for generating the warped images of a
73 | fitting procedure stored within a
74 | :map:`MultiScaleParametricIterativeResult`.
75 |
76 | Parameters
77 | ----------
78 | image : `menpo.image.Image` or `subclass`
79 | The input image to be warped.
80 | shapes : `list` of `menpo.shape.PointCloud`
81 | The list of shapes in which the image will be warped. The shapes
82 | are obtained during the iterations of a fitting procedure.
83 |
84 | Returns
85 | -------
86 | warped_images : `list` of `menpo.image.MaskedImage` or `ndarray`
87 | The warped images.
88 | """
89 | return self.algorithms[-1].interface.warped_images(image=image,
90 | shapes=shapes)
91 |
92 | def __str__(self):
93 | # Compute scale info strings
94 | scales_info = []
95 | lvl_str_tmplt = r""" - Scale {}
96 | - {} active shape components
97 | - {} similarity transform components"""
98 | for k, s in enumerate(self.scales):
99 | scales_info.append(lvl_str_tmplt.format(
100 | s,
101 | self.atm.shape_models[k].n_active_components,
102 | self.atm.shape_models[k].n_global_parameters))
103 | scales_info = '\n'.join(scales_info)
104 |
105 | cls_str = r"""{class_title}
106 | - Scales: {scales}
107 | {scales_info}
108 | """.format(class_title=self.algorithms[0].__str__(),
109 | scales=self.scales,
110 | scales_info=scales_info)
111 | return self.atm.__str__() + cls_str
112 |
--------------------------------------------------------------------------------
/menpofit/base.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | import itertools
3 | import os
4 | import numpy as np
5 |
6 |
7 | def batch(iterable, n):
8 | it = iter(iterable)
9 | while True:
10 | chunk = tuple(itertools.islice(it, n))
11 | if not chunk:
12 | return
13 | yield chunk
14 |
15 |
16 | def build_grid(shape):
17 | r"""
18 | """
19 | shape = np.asarray(shape)
20 | half_shape = np.floor(shape / 2)
21 | half_shape = np.require(half_shape, dtype=int)
22 | start = -half_shape
23 | end = half_shape + shape % 2
24 | sampling_grid = np.mgrid[start[0]:end[0], start[1]:end[1]]
25 | return np.rollaxis(sampling_grid, 0, 3)
26 |
27 |
28 | class MenpoFitCostsWarning(Warning):
29 | r"""
30 | A warning that the costs cannot be computed for the selected fitting
31 | algorithm.
32 | """
33 | pass
34 |
35 |
36 | def menpofit_src_dir_path():
37 | r"""The path to the top of the menpofit Python package.
38 |
39 | Useful for locating where the data folder is stored.
40 |
41 | Returns
42 | -------
43 | path : ``pathlib.Path``
44 | The full path to the top of the menpofit package
45 | """
46 | from pathlib import Path # to avoid cluttering the menpo.base namespace
47 | return Path(os.path.abspath(__file__)).parent
48 |
--------------------------------------------------------------------------------
/menpofit/clm/__init__.py:
--------------------------------------------------------------------------------
1 | from .base import CLM
2 | from .fitter import GradientDescentCLMFitter
3 | from .algorithm import ActiveShapeModel, RegularisedLandmarkMeanShift
4 | from .expert import (CorrelationFilterExpertEnsemble, FcnFilterExpertEnsemble,
5 | IncrementalCorrelationFilterThinWrapper)
6 |
--------------------------------------------------------------------------------
/menpofit/clm/algorithm/__init__.py:
--------------------------------------------------------------------------------
1 | from .gd import ActiveShapeModel, RegularisedLandmarkMeanShift
2 |
--------------------------------------------------------------------------------
/menpofit/clm/expert/__init__.py:
--------------------------------------------------------------------------------
1 | from .ensemble import ExpertEnsemble, CorrelationFilterExpertEnsemble, FcnFilterExpertEnsemble
2 | from .base import IncrementalCorrelationFilterThinWrapper
3 |
--------------------------------------------------------------------------------
/menpofit/clm/expert/base.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | from menpo.feature import ndfeature
4 | from menpofit.math.correlationfilter import mccf, imccf
5 |
6 |
7 | @ndfeature
8 | def probability_map(x, axes=(-2, -1)):
9 | r"""
10 | Generates the probability MAP of the image.
11 |
12 | Parameters
13 | ----------
14 | x : `menpo.image.Image` or subclass or `ndarray`
15 | The input image.
16 | axes : ``None`` or `int` or `tuple` of `int`, optional
17 | Axes along which the normalization is performed.
18 |
19 | Returns
20 | -------
21 | probability_map : `menpo.image.Image` or ``(C, X, Y, ..., Z)`` `ndarray`
22 | The probability MAP of the image.
23 | """
24 | x -= np.min(x, axis=axes, keepdims=True)
25 | total = np.sum(x, axis=axes, keepdims=True)
26 | nonzero = total > 0
27 | if np.any(~nonzero):
28 | warnings.warn('some of x axes have 0 variance - uniform probability '
29 | 'maps are used them.')
30 | x[nonzero] /= total[nonzero]
31 | x[~nonzero] = 1 / np.prod(axes)
32 | else:
33 | x /= total
34 | return x
35 |
36 |
37 | class IncrementalCorrelationFilterThinWrapper(object):
38 | r"""
39 | Wrapper class for defining an Incremental Correlation Filter.
40 |
41 | Parameters
42 | ----------
43 | cf_callable : `callable`, optional
44 | The correlation filter function. Possible options are:
45 |
46 | ============ ===========================================
47 | Class Method
48 | ============ ===========================================
49 | :map:`mccf` Multi-Channel Correlation Filter
50 | :map:`mosse` Minimum Output Sum of Squared Errors Filter
51 | ============ ===========================================
52 | icf_callable : `callable`, optional
53 | The incremental correlation filter function. Possible options are:
54 |
55 | ============= =======================================================
56 | Class Method
57 | ============= =======================================================
58 | :map:`imccf` Incremental Multi-Channel Correlation Filter
59 | :map:`imosse` Incremental Minimum Output Sum of Squared Errors Filter
60 | ============= =======================================================
61 | """
62 | def __init__(self, cf_callable=mccf, icf_callable=imccf):
63 | self.cf_callable = cf_callable
64 | self.icf_callable = icf_callable
65 |
66 | def increment(self, A, B, n_x, Z, t):
67 | r"""
68 | Method that trains the correlation filter.
69 |
70 | Parameters
71 | ----------
72 | A : ``(N,)`` `ndarray`
73 | The current auto-correlation array, where
74 | ``N = (patch_h+response_h-1) * (patch_w+response_w-1) * n_channels``
75 | B : ``(N, N)`` `ndarray`
76 | The current cross-correlation array, where
77 | ``N = (patch_h+response_h-1) * (patch_w+response_w-1) * n_channels``
78 | n_x : `int`
79 | The current number of images.
80 | Z : `list` or ``(n_images, n_channels, patch_h, patch_w)`` `ndarray`
81 | The training images (patches). If `list`, then it consists of
82 | `n_images` ``(n_channels, patch_h, patch_w)`` `ndarray` members.
83 | t : ``(1, response_h, response_w)`` `ndarray`
84 | The desired response.
85 |
86 | Returns
87 | -------
88 | correlation_filter : ``(n_channels, response_h, response_w)`` `ndarray`
89 | The learned correlation filter.
90 | auto_correlation : ``(N,)`` `ndarray`
91 | The auto-correlation array, where
92 | ``N = (patch_h+response_h-1) * (patch_w+response_w-1) * n_channels``
93 | cross_correlation : ``(N, N)`` `ndarray`
94 | The cross-correlation array, where
95 | ``N = (patch_h+response_h-1) * (patch_w+response_w-1) * n_channels``
96 | """
97 | # Turn list of X into ndarray
98 | if isinstance(Z, list):
99 | Z = np.asarray(Z)
100 | return self.icf_callable(A, B, n_x, Z, t)
101 |
102 | def train(self, X, t):
103 | r"""
104 | Method that trains the correlation filter.
105 |
106 | Parameters
107 | ----------
108 | X : `list` or ``(n_images, n_channels, patch_h, patch_w)`` `ndarray`
109 | The training images (patches). If `list`, then it consists of
110 | `n_images` ``(n_channels, patch_h, patch_w)`` `ndarray` members.
111 | t : ``(1, response_h, response_w)`` `ndarray`
112 | The desired response.
113 |
114 | Returns
115 | -------
116 | correlation_filter : ``(n_channels, response_h, response_w)`` `ndarray`
117 | The learned correlation filter.
118 | auto_correlation : ``(N,)`` `ndarray`
119 | The auto-correlation array, where
120 | ``N = (patch_h+response_h-1) * (patch_w+response_w-1) * n_channels``
121 | cross_correlation : ``(N, N)`` `ndarray`
122 | The cross-correlation array, where
123 | ``N = (patch_h+response_h-1) * (patch_w+response_w-1) * n_channels``
124 | """
125 | # Turn list of X into ndarray
126 | if isinstance(X, list):
127 | X = np.asarray(X)
128 | # Return linear svm filter and bias
129 | return self.cf_callable(X, t)
130 |
--------------------------------------------------------------------------------
/menpofit/clm/fitter.py:
--------------------------------------------------------------------------------
1 | from menpofit.fitter import MultiScaleParametricFitter
2 | from menpofit import checks
3 |
4 | from .algorithm import RegularisedLandmarkMeanShift
5 |
6 |
7 | class CLMFitter(MultiScaleParametricFitter):
8 | r"""
9 | Abstract class for defining a CLM fitter.
10 |
11 | .. note:: When using a method with a parametric shape model, the first step
12 | is to **reconstruct the initial shape** using the shape model. The
13 | generated reconstructed shape is then used as initialisation for
14 | the iterative optimisation. This step takes place at each scale
15 | and it is not considered as an iteration, thus it is not counted
16 | for the provided `max_iters`.
17 |
18 | Parameters
19 | ----------
20 | clm : :map:`CLM` or `subclass`
21 | The trained CLM model.
22 | algorithms : `list` of `class`
23 | The list of algorithm objects that will perform the fitting per scale.
24 | """
25 | def __init__(self, clm, algorithms):
26 | self._model = clm
27 | # Call superclass
28 | super(CLMFitter, self).__init__(
29 | scales=clm.scales, reference_shape=clm.reference_shape,
30 | holistic_features=clm.holistic_features, algorithms=algorithms)
31 |
32 | @property
33 | def clm(self):
34 | r"""
35 | The trained CLM model.
36 |
37 | :type: :map:`CLM` or `subclass`
38 | """
39 | return self._model
40 |
41 |
42 | class GradientDescentCLMFitter(CLMFitter):
43 | r"""
44 | Class for defining an CLM fitter using gradient descent optimization.
45 |
46 | .. note:: When using a method with a parametric shape model, the first step
47 | is to **reconstruct the initial shape** using the shape model. The
48 | generated reconstructed shape is then used as initialisation for
49 | the iterative optimisation. This step takes place at each scale
50 | and it is not considered as an iteration, thus it is not counted
51 | for the provided `max_iters`.
52 |
53 | Parameters
54 | ----------
55 | clm : :map:`CLM` or `subclass`
56 | The trained CLM model.
57 | gd_algorithm_cls : `class`, optional
58 | The gradient descent optimisation algorithm that will get applied. The
59 | possible options are :map:`RegularisedLandmarkMeanShift` and
60 | :map:`ActiveShapeModel`.
61 | n_shape : `int` or `float` or `list` of those or ``None``, optional
62 | The number of shape components that will be used. If `int`, then it
63 | defines the exact number of active components. If `float`, then it
64 | defines the percentage of variance to keep. If `int` or `float`, then
65 | the provided value will be applied for all scales. If `list`, then it
66 | defines a value per scale. If ``None``, then all the available
67 | components will be used. Note that this simply sets the active
68 | components without trimming the unused ones. Also, the available
69 | components may have already been trimmed to `max_shape_components`
70 | during training.
71 | """
72 | def __init__(self, clm, gd_algorithm_cls=RegularisedLandmarkMeanShift,
73 | n_shape=None):
74 | # Store CLM trained model
75 | self._model = clm
76 |
77 | # Check parameter
78 | checks.set_models_components(clm.shape_models, n_shape)
79 |
80 | # Get list of algorithm objects per scale
81 | algorithms = [gd_algorithm_cls(clm.expert_ensembles[i],
82 | clm.shape_models[i],
83 | kernel_covariance=clm.opt['kernel_covariance'],
84 | kernel_idealmap=clm.opt['sigOffset'],
85 | confidence_gama=clm.opt['sigRate'],
86 | opt=clm.opt)
87 | for i in range(clm.n_scales)]
88 |
89 | # Call superclass
90 | super(GradientDescentCLMFitter, self).__init__(clm=clm,
91 | algorithms=algorithms)
92 |
93 | def __str__(self):
94 | # Compute scale info strings
95 | scales_info = []
96 | lvl_str_tmplt = r""" - Scale {}
97 | - {} active shape components
98 | - {} similarity transform components"""
99 | for k, s in enumerate(self.scales):
100 | scales_info.append(lvl_str_tmplt.format(
101 | s,
102 | self.clm.shape_models[k].n_active_components,
103 | self.clm.shape_models[k].n_global_parameters))
104 | scales_info = '\n'.join(scales_info)
105 |
106 | cls_str = r"""{class_title}
107 | - Scales: {scales}
108 | {scales_info}
109 | """.format(class_title=self.algorithms[0].__str__(),
110 | scales=self.scales,
111 | scales_info=scales_info)
112 | return self.clm.__str__() + cls_str
113 |
--------------------------------------------------------------------------------
/menpofit/compatibility.py:
--------------------------------------------------------------------------------
1 | import sys
2 |
3 | PY2 = sys.version_info[0] == 2
4 | PY3 = sys.version_info[0] == 3
5 |
6 | if PY3:
7 | STRING_TYPES = str
8 | else:
9 | STRING_TYPES = basestring
10 |
--------------------------------------------------------------------------------
/menpofit/differentiable.py:
--------------------------------------------------------------------------------
1 | import abc
2 |
3 |
4 | class DP(object):
5 | r"""
6 | Object that is able to take its own derivative with respect to the
7 | parametrisation.
8 |
9 | The parametrisation of objects is typically defined by the
10 | `menpo.base.Vectorizable` interface. As a result, :map:`DP` is a mix-in
11 | that should be inherited along with `menpo.base.Vectorizable`.
12 | """
13 | __metaclass__ = abc.ABCMeta
14 |
15 | @abc.abstractmethod
16 | def d_dp(self, points):
17 | r"""
18 | The derivative of this spatial object with respect to the
19 | parametrisation changes evaluated at points.
20 |
21 | Parameters
22 | ----------
23 | points : ``(n_points, n_dims)`` `ndarray`
24 | The spatial points at which the derivative should be evaluated.
25 |
26 | Returns
27 | -------
28 | d_dp : ``(n_points, n_parameters, n_dims)`` `ndarray`
29 | The Jacobian with respect to the parametrisation.
30 |
31 | ``d_dp[i, j, k]`` is the scalar differential change that the
32 | ``k``'th dimension of the ``i``'th point experiences due to a first
33 | order change in the ``j``'th scalar in the parametrisation vector.
34 | """
35 |
36 |
37 | class DX(object):
38 | r"""
39 | Object that is able to take its own derivative with respect to spatial
40 | changes.
41 | """
42 | __metaclass__ = abc.ABCMeta
43 |
44 | @abc.abstractmethod
45 | def d_dx(self, points):
46 | r"""
47 | The first order derivative of this spatial object with respect to
48 | spatial changes evaluated at points.
49 |
50 | Parameters
51 | ----------
52 | points : ``(n_points, n_dims)`` `ndarray`
53 | The spatial points at which the derivative should be evaluated.
54 |
55 | Returns
56 | -------
57 | d_dx : ``(n_points, n_dims, n_dims)`` `ndarray`
58 | The Jacobian wrt spatial changes.
59 |
60 | ``d_dx[i, j, k]`` is the scalar differential change that the
61 | ``j``'th dimension of the ``i``'th point experiences due to a first
62 | order change in the ``k``'th dimension.
63 |
64 | It may be the case that the Jacobian is constant across space -
65 | in this case axis zero may have length ``1`` to allow for
66 | broadcasting.
67 | """
68 |
69 |
70 | class DL(object):
71 | r"""
72 | Object that is able to take its own derivative with respect to landmark
73 | changes.
74 | """
75 | __metaclass__ = abc.ABCMeta
76 |
77 | @abc.abstractmethod
78 | def d_dl(self, points):
79 | r"""
80 | The derivative of this spatial object with respect to spatial changes
81 | in anchor landmark points or centres, evaluated at points.
82 |
83 | Parameters
84 | ----------
85 | points : ``(n_points, n_dims)`` `ndarray`
86 | The spatial points at which the derivative should be evaluated.
87 |
88 | Returns
89 | -------
90 | d_dl : ``(n_points, n_centres, n_dims)`` `ndarray`
91 | The Jacobian wrt landmark changes.
92 |
93 | ``d_dl[i, k, m]`` is the scalar differential change that the
94 | any dimension of the ``i``'th point experiences due to a first order
95 | change in the ``m``'th dimension of the ``k``'th landmark point.
96 |
97 | Note that at present this assumes that the change in every
98 | dimension is equal.
99 | """
100 |
--------------------------------------------------------------------------------
/menpofit/dlib/__init__.py:
--------------------------------------------------------------------------------
1 | try:
2 | from .fitter import DlibERT, DlibWrapper
3 | except ImportError:
4 | # If dlib is not installed then we shouldn't import anything into this
5 | # module.
6 | pass
7 |
--------------------------------------------------------------------------------
/menpofit/dlib/conversion.py:
--------------------------------------------------------------------------------
1 | import dlib
2 | import numpy as np
3 |
4 | from menpo.shape import PointCloud, bounding_box
5 |
6 |
7 | all_parts = lambda det: ((p.y, p.x) for p in det.parts())
8 |
9 |
10 | def pointcloud_to_dlib_parts(pcloud):
11 | return [dlib.point(int(p[1]), int(p[0])) for p in pcloud.points]
12 |
13 |
14 | def dlib_full_object_detection_to_pointcloud(full_object_detection):
15 | return PointCloud(np.vstack(all_parts(full_object_detection)), copy=False)
16 |
17 |
18 | def dlib_rect_to_bounding_box(rect):
19 | return bounding_box((rect.top(), rect.left()),
20 | (rect.bottom(), rect.right()))
21 |
22 |
23 | def pointcloud_to_dlib_rect(pg):
24 | min_p, max_p = pg.bounds()
25 | return dlib.rectangle(left=int(min_p[1]), top=int(min_p[0]),
26 | right=int(max_p[1]), bottom=int(max_p[0]))
27 |
28 |
29 | def bounding_box_pointcloud_to_dlib_fo_detection(bbox, pcloud):
30 | return dlib.full_object_detection(
31 | pointcloud_to_dlib_rect(bbox.bounding_box()),
32 | pointcloud_to_dlib_parts(pcloud))
33 |
34 |
35 | def copy_dlib_options(options):
36 | new_options = dlib.shape_predictor_training_options()
37 | for p in sorted(filter(lambda x: '__' not in x, dir(options))):
38 | setattr(new_options, p, getattr(options, p))
39 | return new_options
40 |
41 |
42 | def image_to_dlib_pixels(im):
43 | pixels = np.array(im.as_PILImage())
44 | # Only supports RGB and Grayscale
45 | if im.n_channels > 3:
46 | pixels = pixels[..., 0]
47 | return pixels
48 |
--------------------------------------------------------------------------------
/menpofit/error/__init__.py:
--------------------------------------------------------------------------------
1 | from .base import (bb_area, bb_perimeter, bb_avg_edge_length, bb_diagonal, inner_pupil, bb_sqrt_edge_length,
2 | distance_two_indices, root_mean_square_error,
3 | euclidean_error, root_mean_square_bb_normalised_error,
4 | root_mean_square_distance_normalised_error,
5 | root_mean_square_distance_indexed_normalised_error,
6 | euclidean_bb_normalised_error,
7 | euclidean_distance_normalised_error,
8 | euclidean_distance_indexed_normalised_error)
9 | from .stats import (compute_cumulative_error, mad,
10 | area_under_curve_and_failure_rate,
11 | compute_statistical_measures)
12 | from .human import (mean_pupil_68_error, mean_pupil_49_error,
13 | outer_eye_corner_68_euclidean_error,
14 | outer_eye_corner_51_euclidean_error,
15 | outer_eye_corner_49_euclidean_error,
16 | bb_avg_edge_length_68_euclidean_error,
17 | bb_avg_edge_length_49_euclidean_error)
18 |
--------------------------------------------------------------------------------
/menpofit/error/human/__init__.py:
--------------------------------------------------------------------------------
1 | from .face import (mean_pupil_68_error, mean_pupil_49_error,
2 | outer_eye_corner_68_euclidean_error,
3 | outer_eye_corner_51_euclidean_error,
4 | outer_eye_corner_49_euclidean_error,
5 | bb_avg_edge_length_68_euclidean_error,
6 | bb_avg_edge_length_49_euclidean_error)
7 |
--------------------------------------------------------------------------------
/menpofit/error/stats.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | import numpy as np
3 | from scipy.integrate import simps
4 | from collections import Iterable
5 |
6 |
7 | def compute_cumulative_error(errors, bins):
8 | r"""
9 | Computes the values of the Cumulative Error Distribution (CED).
10 |
11 | Parameters
12 | ----------
13 | errors : `list` of `float`
14 | The `list` of errors per image.
15 | bins : `list` of `float`
16 | The values of the error bins centers at which the CED is evaluated.
17 |
18 | Returns
19 | -------
20 | ced : `list` of `float`
21 | The computed CED.
22 | """
23 | n_errors = len(errors)
24 | return [np.count_nonzero([errors <= x]) / n_errors for x in bins]
25 |
26 |
27 | def mad(errors):
28 | r"""
29 | Computes the Median Absolute Deviation of a set of errors.
30 |
31 | Parameters
32 | ----------
33 | errors : `list` of `float`
34 | The `list` of errors per image.
35 |
36 | Returns
37 | -------
38 | mad : `float`
39 | The median absolute deviation value.
40 | """
41 | med = np.median(errors)
42 | return np.median(np.abs(errors - med))
43 |
44 |
45 | def area_under_curve_and_failure_rate(errors, step_error, max_error,
46 | min_error=0.):
47 | r"""
48 | Computes the Area Under the Curve (AUC) and Failure Rate (FR) of a given
49 | Cumulative Distribution Error (CED).
50 |
51 | Parameters
52 | ----------
53 | errors : `list` of `float`
54 | The `list` of errors per image.
55 | step_error : `float`
56 | The sampling step of the error bins of the CED.
57 | max_error : `float`
58 | The maximum error value of the CED.
59 | min_error : `float`
60 | The minimum error value of the CED.
61 |
62 | Returns
63 | -------
64 | auc : `float`
65 | The Area Under the Curve value.
66 | fr : `float`
67 | The Failure Rate value.
68 | """
69 | x_axis = list(np.arange(min_error, max_error + step_error, step_error))
70 | ced = np.array(compute_cumulative_error(errors, x_axis))
71 | return simps(ced, x=x_axis) / max_error, 1. - ced[-1]
72 |
73 |
74 | def compute_statistical_measures(errors, step_error, max_error, min_error=0.):
75 | r"""
76 | Computes various statistics given a set of errors that correspond to
77 | multiple images. It can also deal with multiple sets of errors that
78 | correspond to different methods.
79 |
80 | Parameters
81 | ----------
82 | errors : `list` of `float` or `list` of `list` of `float`
83 | The `list` of errors per image. You can provide a `list` of `lists`
84 | for the errors of multiple methods.
85 | step_error : `float`
86 | The sampling step of the error bins of the CED for computing the Area
87 | Under the Curve and the Failure Rate.
88 | max_error : `float`
89 | The maximum error value of the CED for computing the Area Under the
90 | Curve and the Failure Rate.
91 | min_error : `float`
92 | The minimum error value of the CED for computing the Area Under the
93 | Curve and the Failure Rate.
94 |
95 | Returns
96 | -------
97 | mean : `float` or `list` of `float`
98 | The mean value.
99 | mean : `float` or `list` of `float`
100 | The standard deviation.
101 | median : `float` or `list` of `float`
102 | The median value.
103 | mad : `float` or `list` of `float`
104 | The mean absolute deviation value.
105 | max : `float` or `list` of `float`
106 | The maximum value.
107 | auc : `float` or `list` of `float`
108 | The area under the curve value.
109 | fr : `float` or `list` of `float`
110 | The failure rate value.
111 | """
112 | if isinstance(errors[0], Iterable):
113 | mean_val = []
114 | std_val = []
115 | median_val = []
116 | mad_val = []
117 | max_val = []
118 | auc_val = []
119 | fail_val = []
120 | for e in errors:
121 | mean_val.append(np.mean(e))
122 | std_val.append(np.std(e))
123 | median_val.append(np.median(e))
124 | mad_val.append(mad(e))
125 | max_val.append(np.max(e))
126 | auc_v, fail_v = area_under_curve_and_failure_rate(
127 | e, step_error=step_error, max_error=max_error,
128 | min_error=min_error)
129 | auc_val.append(auc_v)
130 | fail_val.append(fail_v)
131 | else:
132 | mean_val = np.mean(errors)
133 | std_val = np.std(errors)
134 | median_val = np.median(errors)
135 | mad_val = mad(errors)
136 | max_val = np.max(errors)
137 | auc_val, fail_val = area_under_curve_and_failure_rate(
138 | errors, step_error=step_error, max_error=max_error,
139 | min_error=min_error)
140 | return mean_val, std_val, median_val, mad_val, max_val, auc_val, fail_val
141 |
--------------------------------------------------------------------------------
/menpofit/lk/__init__.py:
--------------------------------------------------------------------------------
1 | from .fitter import LucasKanadeFitter
2 | from .algorithm import (ForwardAdditive, ForwardCompositional,
3 | InverseCompositional)
4 | from .residual import (SSD, FourierSSD, ECC, GradientImages,
5 | GradientCorrelation)
6 |
--------------------------------------------------------------------------------
/menpofit/lk/result.py:
--------------------------------------------------------------------------------
1 | from menpofit.result import (ParametricIterativeResult,
2 | MultiScaleParametricIterativeResult)
3 |
4 |
5 | class LucasKanadeAlgorithmResult(ParametricIterativeResult):
6 | r"""
7 | Class for storing the iterative result of a Lucas-Kanade Image Alignment
8 | optimization algorithm.
9 |
10 | Parameters
11 | ----------
12 | shapes : `list` of `menpo.shape.PointCloud`
13 | The `list` of shapes per iteration. The first and last members
14 | correspond to the initial and final shapes, respectively.
15 | homogeneous_parameters : `list` of ``(n_parameters,)`` `ndarray`
16 | The `list` of parameters of the homogeneous transform per iteration.
17 | The first and last members correspond to the initial and final
18 | shapes, respectively.
19 | initial_shape : `menpo.shape.PointCloud` or ``None``, optional
20 | The initial shape from which the fitting process started. If
21 | ``None``, then no initial shape is assigned.
22 | image : `menpo.image.Image` or `subclass` or ``None``, optional
23 | The image on which the fitting process was applied. Note that a copy
24 | of the image will be assigned as an attribute. If ``None``, then no
25 | image is assigned.
26 | gt_shape : `menpo.shape.PointCloud` or ``None``, optional
27 | The ground truth shape associated with the image. If ``None``, then no
28 | ground truth shape is assigned.
29 | costs : `list` of `float` or ``None``, optional
30 | The `list` of cost per iteration. If ``None``, then it is assumed that
31 | the cost function cannot be computed for the specific algorithm.
32 | """
33 | def __init__(self, shapes, homogeneous_parameters, initial_shape=None,
34 | image=None, gt_shape=None, costs=None):
35 | super(LucasKanadeAlgorithmResult, self).__init__(
36 | shapes=shapes, shape_parameters=homogeneous_parameters,
37 | initial_shape=initial_shape, image=image, gt_shape=gt_shape,
38 | costs=costs)
39 | self._homogeneous_parameters = homogeneous_parameters
40 |
41 | @property
42 | def homogeneous_parameters(self):
43 | r"""
44 | Returns the `list` of parameters of the homogeneous transform
45 | obtained at each iteration of the fitting process. The `list`
46 | includes the parameters of the `initial_shape` (if it exists) and
47 | `final_shape`.
48 |
49 | :type: `list` of ``(n_params,)`` `ndarray`
50 | """
51 | return self._shape_parameters
52 |
53 |
54 | class LucasKanadeResult(MultiScaleParametricIterativeResult):
55 | r"""
56 | Class for storing the multi-scale iterative fitting result of an ATM. It
57 | holds the shapes, shape parameters and costs per iteration.
58 |
59 | Parameters
60 | ----------
61 | results : `list` of :map:`ATMAlgorithmResult`
62 | The `list` of optimization results per scale.
63 | scales : `list` or `tuple`
64 | The `list` of scale values per scale (low to high).
65 | affine_transforms : `list` of `menpo.transform.Affine`
66 | The list of affine transforms per scale that transform the shapes into
67 | the original image space.
68 | scale_transforms : `list` of `menpo.shape.Scale`
69 | The list of scaling transforms per scale.
70 | image : `menpo.image.Image` or `subclass` or ``None``, optional
71 | The image on which the fitting process was applied. Note that a copy
72 | of the image will be assigned as an attribute. If ``None``, then no
73 | image is assigned.
74 | gt_shape : `menpo.shape.PointCloud` or ``None``, optional
75 | The ground truth shape associated with the image. If ``None``, then no
76 | ground truth shape is assigned.
77 | """
78 | def __init__(self, results, scales, affine_transforms, scale_transforms,
79 | image=None, gt_shape=None):
80 | super(LucasKanadeResult, self).__init__(
81 | results=results, scales=scales, affine_transforms=affine_transforms,
82 | scale_transforms=scale_transforms, image=image, gt_shape=gt_shape)
83 | # Create parameters list
84 | self._homogeneous_parameters = []
85 | for r in results:
86 | self._homogeneous_parameters += r.homogeneous_parameters
87 | # Correct n_iters
88 | self._n_iters -= len(scales)
89 |
90 | @property
91 | def homogeneous_parameters(self):
92 | r"""
93 | Returns the `list` of parameters of the homogeneous transform
94 | obtained at each iteration of the fitting process. The `list`
95 | includes the parameters of the `initial_shape` (if it exists) and
96 | `final_shape`.
97 |
98 | :type: `list` of ``(n_params,)`` `ndarray`
99 | """
100 | return self._homogeneous_parameters
101 |
102 | @property
103 | def shape_parameters(self):
104 | # Use homogeneous_parameters instead.
105 | raise AttributeError
106 |
--------------------------------------------------------------------------------
/menpofit/math/__init__.py:
--------------------------------------------------------------------------------
1 | from .regression import (IRLRegression, IIRLRegression, PCRRegression,
2 | OptimalLinearRegression, OPPRegression)
3 | from .correlationfilter import mccf, imccf, mosse, imosse
4 |
--------------------------------------------------------------------------------
/menpofit/sdm/__init__.py:
--------------------------------------------------------------------------------
1 | from .fitter import SupervisedDescentFitter, SDM, RegularizedSDM
2 | from .algorithm import (NonParametricNewton, NonParametricGaussNewton,
3 | NonParametricPCRRegression,
4 | NonParametricOptimalRegression,
5 | NonParametricOPPRegression)
6 | from .algorithm import (ParametricShapeNewton,
7 | ParametricShapeGaussNewton,
8 | ParametricShapeOptimalRegression,
9 | ParametricShapePCRRegression,
10 | ParametricShapeOPPRegression)
11 | from .algorithm import (ParametricAppearanceProjectOutNewton,
12 | ParametricAppearanceMeanTemplateGuassNewton,
13 | ParametricAppearanceMeanTemplateNewton,
14 | ParametricAppearanceProjectOutGuassNewton,
15 | ParametricAppearanceWeightsGuassNewton,
16 | ParametricAppearanceWeightsNewton)
17 | from .algorithm import (FullyParametricProjectOutNewton,
18 | FullyParametricProjectOutGaussNewton,
19 | FullyParametricMeanTemplateNewton,
20 | FullyParametricWeightsNewton,
21 | FullyParametricProjectOutOPP)
22 |
--------------------------------------------------------------------------------
/menpofit/sdm/algorithm/__init__.py:
--------------------------------------------------------------------------------
1 | from .nonparametric import (NonParametricNewton, NonParametricGaussNewton,
2 | NonParametricPCRRegression,
3 | NonParametricOptimalRegression,
4 | NonParametricOPPRegression)
5 | from .parametricshape import (ParametricShapeNewton, ParametricShapeGaussNewton,
6 | ParametricShapeOptimalRegression,
7 | ParametricShapePCRRegression,
8 | ParametricShapeOPPRegression)
9 | from .parametricappearance import (ParametricAppearanceProjectOutNewton,
10 | ParametricAppearanceMeanTemplateGuassNewton,
11 | ParametricAppearanceMeanTemplateNewton,
12 | ParametricAppearanceProjectOutGuassNewton,
13 | ParametricAppearanceWeightsGuassNewton,
14 | ParametricAppearanceWeightsNewton)
15 | from .fullyparametric import (FullyParametricProjectOutNewton,
16 | FullyParametricProjectOutGaussNewton,
17 | FullyParametricMeanTemplateNewton,
18 | FullyParametricWeightsNewton,
19 | FullyParametricProjectOutOPP)
20 |
--------------------------------------------------------------------------------
/menpofit/transform/__init__.py:
--------------------------------------------------------------------------------
1 | from .modeldriven import OrthoMDTransform, LinearOrthoMDTransform
2 | from .homogeneous import (DifferentiableAffine, DifferentiableSimilarity,
3 | DifferentiableAlignmentSimilarity,
4 | DifferentiableAlignmentAffine)
5 | from .piecewiseaffine import DifferentiablePiecewiseAffine
6 | from .thinsplatesplines import DifferentiableThinPlateSplines
7 | from .rbf import DifferentiableR2LogR2RBF, DifferentiableR2LogRRBF
8 |
--------------------------------------------------------------------------------
/menpofit/transform/piecewiseaffine.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from menpo.transform import PiecewiseAffine
3 | from menpofit.differentiable import DL, DX
4 |
5 |
6 | class DifferentiablePiecewiseAffine(PiecewiseAffine, DL, DX):
7 | r"""
8 | A differentiable Piecewise Affine Transformation.
9 |
10 | This is composed of a number of triangles defined be a set of `source` and
11 | `target` vertices. These vertices are related by a common triangle `list`.
12 | No limitations on the nature of the triangle `list` are imposed. Points can
13 | then be mapped via barycentric coordinates from the `source` to the `target`
14 | space. Trying to map points that are not contained by any source triangle
15 | throws a `TriangleContainmentError`, which contains diagnostic information.
16 |
17 | The transform can compute its own derivative with respect to spatial changes,
18 | as well as anchor landmark changes.
19 | """
20 |
21 | def d_dl(self, points):
22 | r"""
23 | The derivative of the warp with respect to spatial changes in anchor
24 | landmark points or centres, evaluated at points.
25 |
26 | Parameters
27 | ----------
28 | points : ``(n_points, n_dims)`` `ndarray`
29 | The spatial points at which the derivative should be evaluated.
30 |
31 | Returns
32 | -------
33 | d_dl : ``(n_points, n_centres, n_dims)`` `ndarray`
34 | The Jacobian wrt landmark changes.
35 |
36 | ``d_dl[i, k, m]`` is the scalar differential change that the
37 | any dimension of the ``i``'th point experiences due to a first order
38 | change in the ``m``'th dimension of the ``k``'th landmark point.
39 |
40 | Note that at present this assumes that the change in every
41 | dimension is equal.
42 | """
43 | tri_index, alpha_i, beta_i = self.index_alpha_beta(points)
44 | # for the jacobian we only need
45 | # gamma = 1 - alpha - beta
46 | # for each vertex (i, j, & k)
47 | # gamma is the 'far edge' weighting wrt the vertex in question.
48 | # given gamma implicitly for the first vertex in our trilist,
49 | # we can permute around to get the others. (e.g. rotate CW around
50 | # the triangle to get the j'th vertex-as-prime variant,
51 | # and once again to the kth).
52 | #
53 | # alpha_j = 1 - alpha_i - beta_i
54 | # gamma_j = alpha_i
55 | # gamma_k = beta_i
56 | #
57 | # TODO this ordering is empirically correct but I don't know why..
58 | #
59 | # we stack all the gamma's together
60 | # so gamma_ijk.shape = (n_sample_points, 3)
61 | gamma_ijk = np.hstack(((1 - alpha_i - beta_i)[:, None],
62 | alpha_i[:, None],
63 | beta_i[:, None]))
64 | # the jacobian wrt source is of shape
65 | # (n_sample_points, n_source_points, 2)
66 | jac = np.zeros((points.shape[0], self.n_points, 2))
67 | # per sample point, find the source points for the ijk vertices of
68 | # the containing triangle - only these points will get a non 0
69 | # jacobian value
70 | ijk_per_point = self.trilist[tri_index]
71 | # to index into the jacobian, we just need a linear iterator for the
72 | # first axis - literally [0, 1, ... , n_sample_points]. The
73 | # reshape is needed to make it broadcastable with the other indexing
74 | # term, ijk_per_point.
75 | linear_iterator = np.arange(points.shape[0]).reshape((-1, 1))
76 | # in one line, we are done.
77 | jac[linear_iterator, ijk_per_point] = gamma_ijk[..., None]
78 | return jac
79 |
80 | def d_dx(self, points):
81 | r"""
82 | The first order derivative of the warp with respect to spatial changes
83 | evaluated at points.
84 |
85 | Parameters
86 | ----------
87 | points : ``(n_points, n_dims)`` `ndarray`
88 | The spatial points at which the derivative should be evaluated.
89 |
90 | Returns
91 | -------
92 | d_dx : ``(n_points, n_dims, n_dims)`` `ndarray`
93 | The Jacobian wrt spatial changes.
94 |
95 | ``d_dx[i, j, k]`` is the scalar differential change that the
96 | ``j``'th dimension of the ``i``'th point experiences due to a first
97 | order change in the ``k``'th dimension.
98 |
99 | It may be the case that the Jacobian is constant across space -
100 | in this case axis zero may have length ``1`` to allow for
101 | broadcasting.
102 |
103 | Raises
104 | ------
105 | TriangleContainmentError:
106 | If any point is outside any triangle of this PWA.
107 | """
108 | # TODO check for position and return true d_dx (see docstring)
109 | # for the time being we assume the points are on the source landmarks
110 | return np.eye(2, 2)[None, ...]
111 |
--------------------------------------------------------------------------------
/menpofit/transform/rbf.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from scipy.spatial.distance import cdist
3 |
4 | from menpo.transform.rbf import R2LogR2RBF, R2LogRRBF
5 |
6 | from menpofit.differentiable import DL
7 |
8 |
9 | class DifferentiableR2LogRRBF(R2LogRRBF, DL):
10 | r"""
11 | Calculates the :math:`r^2 \log{r}` basis function.
12 |
13 | The derivative of this function is :math:`r (1 + 2 \log{r})`, where
14 | :math:`r = \lVert x - c \rVert`.
15 |
16 | It can compute its own derivative with respect to landmark changes.
17 | """
18 |
19 | def d_dl(self, points):
20 | """
21 | The derivative of the basis function wrt the coordinate system
22 | evaluated at `points`. Let `points` be :math:`x`, then
23 | :math:`(x - c)^T (1 + 2\log{r_{x, l}})`, where
24 | :math:`r_{x, l} = \| x - c \|`.
25 |
26 | Parameters
27 | ----------
28 | points : ``(n_points, n_dims)`` `ndarray`
29 | The spatial points at which the derivative should be evaluated.
30 |
31 | Returns
32 | -------
33 | d_dl : ``(n_points, n_centres, n_dims)`` `ndarray`
34 | The Jacobian wrt landmark changes.
35 | """
36 | euclidean_distance = cdist(points, self.c)
37 | component_distances = points[:, None, :] - self.c
38 | # Avoid log(0) and set to 1 so that log(1) = 0
39 | euclidean_distance[euclidean_distance == 0] = 1
40 | d_dl = (component_distances *
41 | (1 + 2 * np.log(euclidean_distance[..., None])))
42 | return d_dl
43 |
44 |
45 | class DifferentiableR2LogR2RBF(R2LogR2RBF, DL):
46 | r"""
47 | The :math:`r^2 \log{r^2}` basis function.
48 |
49 | The derivative of this function is :math:`2 r (\log{r^2} + 1)`, where
50 | :math:`r = \lVert x - c \rVert`.
51 |
52 | It can compute its own derivative with respect to landmark changes.
53 | """
54 |
55 | def d_dl(self, points):
56 | """
57 | Apply the derivative of the basis function wrt the centres and the
58 | points given by `points`. Let `points` be :math:`x`, then
59 | :math:`2(x - c)^T (\log{r^2_{x, l}}+1) = 2(x - c)^T (2\log{r_{x, l}}+1)`
60 | where :math:`r_{x, l} = \| x - c \|`.
61 |
62 | Parameters
63 | ----------
64 | points : ``(n_points, n_dims)`` `ndarray`
65 | The spatial points at which the derivative should be evaluated.
66 |
67 | Returns
68 | -------
69 | d_dl : ``(n_points, n_centres, n_dims)`` `ndarray`
70 | The jacobian tensor representing the first order derivative
71 | of the radius from each centre wrt the centre's position, evaluated
72 | at each point.
73 | """
74 | euclidean_distance = cdist(points, self.c)
75 | component_distances = points[:, None, :] - self.c
76 | # Avoid log(0) and set to 1 so that log(1) = 0
77 | euclidean_distance[euclidean_distance == 0] = 1
78 | d_dl = (2 * component_distances *
79 | (2 * np.log(euclidean_distance[..., None]) + 1))
80 | return d_dl
81 |
--------------------------------------------------------------------------------
/menpofit/transform/test/__init__.py:
--------------------------------------------------------------------------------
1 | __author__ = 'jab08'
2 |
--------------------------------------------------------------------------------
/menpofit/transform/test/h_affine_test.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from numpy.testing import assert_equal
3 |
4 | from menpofit.transform import DifferentiableAffine
5 |
6 |
7 | jac_solution2d = np.array(
8 | [[[0., 0.],
9 | [0., 0.],
10 | [0., 0.],
11 | [0., 0.],
12 | [1., 0.],
13 | [0., 1.]],
14 | [[0., 0.],
15 | [0., 0.],
16 | [1., 0.],
17 | [0., 1.],
18 | [1., 0.],
19 | [0., 1.]],
20 | [[0., 0.],
21 | [0., 0.],
22 | [2., 0.],
23 | [0., 2.],
24 | [1., 0.],
25 | [0., 1.]],
26 | [[1., 0.],
27 | [0., 1.],
28 | [0., 0.],
29 | [0., 0.],
30 | [1., 0.],
31 | [0., 1.]],
32 | [[1., 0.],
33 | [0., 1.],
34 | [1., 0.],
35 | [0., 1.],
36 | [1., 0.],
37 | [0., 1.]],
38 | [[1., 0.],
39 | [0., 1.],
40 | [2., 0.],
41 | [0., 2.],
42 | [1., 0.],
43 | [0., 1.]]])
44 |
45 | jac_solution3d = np.array(
46 | [[[0., 0., 0.],
47 | [0., 0., 0.],
48 | [0., 0., 0.],
49 | [0., 0., 0.],
50 | [0., 0., 0.],
51 | [0., 0., 0.],
52 | [0., 0., 0.],
53 | [0., 0., 0.],
54 | [0., 0., 0.],
55 | [1., 0., 0.],
56 | [0., 1., 0.],
57 | [0., 0., 1.]],
58 | [[0., 0., 0.],
59 | [0., 0., 0.],
60 | [0., 0., 0.],
61 | [0., 0., 0.],
62 | [0., 0., 0.],
63 | [0., 0., 0.],
64 | [1., 0., 0.],
65 | [0., 1., 0.],
66 | [0., 0., 1.],
67 | [1., 0., 0.],
68 | [0., 1., 0.],
69 | [0., 0., 1.]],
70 | [[0., 0., 0.],
71 | [0., 0., 0.],
72 | [0., 0., 0.],
73 | [1., 0., 0.],
74 | [0., 1., 0.],
75 | [0., 0., 1.],
76 | [0., 0., 0.],
77 | [0., 0., 0.],
78 | [0., 0., 0.],
79 | [1., 0., 0.],
80 | [0., 1., 0.],
81 | [0., 0., 1.]],
82 | [[0., 0., 0.],
83 | [0., 0., 0.],
84 | [0., 0., 0.],
85 | [1., 0., 0.],
86 | [0., 1., 0.],
87 | [0., 0., 1.],
88 | [1., 0., 0.],
89 | [0., 1., 0.],
90 | [0., 0., 1.],
91 | [1., 0., 0.],
92 | [0., 1., 0.],
93 | [0., 0., 1.]],
94 | [[0., 0., 0.],
95 | [0., 0., 0.],
96 | [0., 0., 0.],
97 | [2., 0., 0.],
98 | [0., 2., 0.],
99 | [0., 0., 2.],
100 | [0., 0., 0.],
101 | [0., 0., 0.],
102 | [0., 0., 0.],
103 | [1., 0., 0.],
104 | [0., 1., 0.],
105 | [0., 0., 1.]],
106 | [[0., 0., 0.],
107 | [0., 0., 0.],
108 | [0., 0., 0.],
109 | [2., 0., 0.],
110 | [0., 2., 0.],
111 | [0., 0., 2.],
112 | [1., 0., 0.],
113 | [0., 1., 0.],
114 | [0., 0., 1.],
115 | [1., 0., 0.],
116 | [0., 1., 0.],
117 | [0., 0., 1.]],
118 | [[1., 0., 0.],
119 | [0., 1., 0.],
120 | [0., 0., 1.],
121 | [0., 0., 0.],
122 | [0., 0., 0.],
123 | [0., 0., 0.],
124 | [0., 0., 0.],
125 | [0., 0., 0.],
126 | [0., 0., 0.],
127 | [1., 0., 0.],
128 | [0., 1., 0.],
129 | [0., 0., 1.]],
130 | [[1., 0., 0.],
131 | [0., 1., 0.],
132 | [0., 0., 1.],
133 | [0., 0., 0.],
134 | [0., 0., 0.],
135 | [0., 0., 0.],
136 | [1., 0., 0.],
137 | [0., 1., 0.],
138 | [0., 0., 1.],
139 | [1., 0., 0.],
140 | [0., 1., 0.],
141 | [0., 0., 1.]],
142 | [[1., 0., 0.],
143 | [0., 1., 0.],
144 | [0., 0., 1.],
145 | [1., 0., 0.],
146 | [0., 1., 0.],
147 | [0., 0., 1.],
148 | [0., 0., 0.],
149 | [0., 0., 0.],
150 | [0., 0., 0.],
151 | [1., 0., 0.],
152 | [0., 1., 0.],
153 | [0., 0., 1.]],
154 | [[1., 0., 0.],
155 | [0., 1., 0.],
156 | [0., 0., 1.],
157 | [1., 0., 0.],
158 | [0., 1., 0.],
159 | [0., 0., 1.],
160 | [1., 0., 0.],
161 | [0., 1., 0.],
162 | [0., 0., 1.],
163 | [1., 0., 0.],
164 | [0., 1., 0.],
165 | [0., 0., 1.]],
166 | [[1., 0., 0.],
167 | [0., 1., 0.],
168 | [0., 0., 1.],
169 | [2., 0., 0.],
170 | [0., 2., 0.],
171 | [0., 0., 2.],
172 | [0., 0., 0.],
173 | [0., 0., 0.],
174 | [0., 0., 0.],
175 | [1., 0., 0.],
176 | [0., 1., 0.],
177 | [0., 0., 1.]],
178 | [[1., 0., 0.],
179 | [0., 1., 0.],
180 | [0., 0., 1.],
181 | [2., 0., 0.],
182 | [0., 2., 0.],
183 | [0., 0., 2.],
184 | [1., 0., 0.],
185 | [0., 1., 0.],
186 | [0., 0., 1.],
187 | [1., 0., 0.],
188 | [0., 1., 0.],
189 | [0., 0., 1.]]])
190 |
191 |
192 | def test_affine_jacobian_2d_with_positions():
193 | params = np.array([0, 0.1, 0.2, 0, 30, 70])
194 | t = DifferentiableAffine.init_identity(2).from_vector(params)
195 | explicit_pixel_locations = np.array(
196 | [[0, 0],
197 | [0, 1],
198 | [0, 2],
199 | [1, 0],
200 | [1, 1],
201 | [1, 2]])
202 | dW_dp = t.d_dp(explicit_pixel_locations)
203 | assert_equal(dW_dp, jac_solution2d)
204 |
205 |
206 | def test_affine_jacobian_3d_with_positions():
207 | params = np.ones(12)
208 | t = DifferentiableAffine.init_identity(3).from_vector(params)
209 | explicit_pixel_locations = np.array(
210 | [[0, 0, 0],
211 | [0, 0, 1],
212 | [0, 1, 0],
213 | [0, 1, 1],
214 | [0, 2, 0],
215 | [0, 2, 1],
216 | [1, 0, 0],
217 | [1, 0, 1],
218 | [1, 1, 0],
219 | [1, 1, 1],
220 | [1, 2, 0],
221 | [1, 2, 1]])
222 | dW_dp = t.d_dp(explicit_pixel_locations)
223 | assert_equal(dW_dp, jac_solution3d)
224 |
--------------------------------------------------------------------------------
/menpofit/transform/test/rbf_test.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from numpy.testing import assert_allclose
3 | from menpofit.transform import (DifferentiableR2LogRRBF,
4 | DifferentiableR2LogR2RBF)
5 |
6 |
7 | centers = np.array([[-1.0, -1.0], [-1, 1], [1, -1], [1, 1]])
8 | points = np.array([[-0.4, -1.5], [-0.1, 1.1], [0.1, -2], [2.3, 0.3]])
9 |
10 |
11 | def test_rbf_r2logr2_d_dl():
12 | result = DifferentiableR2LogR2RBF(centers).d_dl(points)
13 | expected = np.array([[[0.60684441, -0.50570368],
14 | [3.46630038, -14.44291827],
15 | [-5.02037904, -1.79299252],
16 | [-8.69498819, -15.52676462]],
17 | [[4.77449532, 11.14048909],
18 | [1.44278831, 0.16030981],
19 | [-5.99792966, 11.45059299],
20 | [-2.63747189, 0.23977017]],
21 | [[3.94458353, -3.58598503],
22 | [7.31140879, -19.94020579],
23 | [-2.86798832, -3.18665369],
24 | [-5.91012409, -19.70041364]],
25 | [[23.31191446, 9.18348145],
26 | [22.65025903, -4.8046004],
27 | [5.76647684, 5.76647684],
28 | [4.62624468, -2.49105483]]])
29 | assert_allclose(result, expected)
30 |
31 |
32 | def test_rbf_r2logr_d_dl():
33 | result = DifferentiableR2LogRRBF(centers).d_dl(points)
34 | expected = np.array([[[0.30342221, -0.25285184],
35 | [1.73315019, -7.22145913],
36 | [-2.51018952, -0.89649626],
37 | [-4.34749409, -7.76338231]],
38 | [[2.38724766, 5.57024454],
39 | [0.72139416, 0.08015491],
40 | [-2.99896483, 5.72529649],
41 | [-1.31873594, 0.11988509]],
42 | [[1.97229177, -1.79299252],
43 | [3.6557044, -9.9701029],
44 | [-1.43399416, -1.59332685],
45 | [-2.95506205, -9.85020682]],
46 | [[11.65595723, 4.59174073],
47 | [11.32512951, -2.4023002],
48 | [2.88323842, 2.88323842],
49 | [2.31312234, -1.24552741]]])
50 | assert_allclose(result, expected)
51 |
--------------------------------------------------------------------------------
/menpofit/transform/test/tps_test.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from numpy.testing import assert_allclose
3 |
4 | from menpo.shape import PointCloud
5 | from menpofit.transform import DifferentiableThinPlateSplines
6 |
7 |
8 | def test_tps_d_dx():
9 | src = PointCloud(np.array([[-1.0, -1.0], [-1, 1], [1, -1], [1, 1]]))
10 | tgt = PointCloud(np.array([[-2.0, -2.0], [-2, 2], [2, -2], [2, 2]]))
11 | tps = DifferentiableThinPlateSplines(src, tgt)
12 | result = tps.d_dx(src.points)
13 |
14 | assert_allclose(result, np.array([[[2, 0], [0., 2]],
15 | [[2, 0], [0, 2]],
16 | [[2, 0], [0, 2]],
17 | [[2, 0], [0, 2]]]), atol=10 ** -6)
18 |
19 |
20 | def test_tps_d_dl():
21 | src = PointCloud(np.array([[-1.0, -1.0], [-1, 1], [1, -1], [1, 1]]))
22 | tgt = PointCloud(np.array([[-2.0, -2.0], [-2, 2], [2, -2], [2, 2]]))
23 | pts = np.array([[-0.1, -1.0], [-0.5, 1.0], [2.1, -2.5]])
24 | tps = DifferentiableThinPlateSplines(src, tgt)
25 | result = tps.d_dl(pts)
26 | expected = np.array([[[0.55399517, 0.55399517], [-0.00399517, -0.00399517],
27 | [0.44600483, 0.44600483], [0.00399517, 0.00399517]],
28 | [[-0.01625165, -0.01625165], [0.76625165, 0.76625165],
29 | [0.01625165, 0.01625165], [0.23374835, 0.23374835]],
30 | [[0.01631597, 0.01631597], [-0.56631597, -0.56631597],
31 | [1.73368403, 1.73368403],
32 | [-0.18368403, -0.18368403]]])
33 | assert_allclose(result, expected, rtol=10 ** -6)
34 |
--------------------------------------------------------------------------------
/menpofit/visualize/__init__.py:
--------------------------------------------------------------------------------
1 | from .textutils import print_progress, statistics_table
2 | from .base import (view_image_multiple_landmarks,
3 | plot_cumulative_error_distribution)
4 |
--------------------------------------------------------------------------------
/old/eval_scripts/evaluate_and_compare_multiple_models.py:
--------------------------------------------------------------------------------
1 | from evaluation_functions import *
2 | from glob import glob
3 |
4 | flags = tf.app.flags
5 |
6 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
7 | models_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/ect_like/saved_models/test'
8 |
9 | # define paths
10 | flags.DEFINE_string('img_dir', data_dir, 'data directory')
11 | flags.DEFINE_string('test_data', 'test', 'test set to use full/common/challenging/test/art')
12 | flags.DEFINE_string('models_dir', models_dir, 'directory containing multiple models to evaluate and compare')
13 |
14 | # parameters used to train network
15 | flags.DEFINE_integer('image_size', 256, 'image size')
16 | flags.DEFINE_integer('c_dim', 3, 'color channels')
17 | flags.DEFINE_integer('num_landmarks', 68, 'number of face landmarks')
18 | flags.DEFINE_integer('scale', 1, 'scale for image normalization 255/1/0')
19 | flags.DEFINE_float('margin', 0.25, 'margin for face crops - % of bb size')
20 | flags.DEFINE_string('bb_type', 'gt', "bb to use - 'gt':for ground truth / 'init':for face detector output")
21 |
22 | # choose batch size and debug data size
23 | flags.DEFINE_integer('batch_size', 10, 'batch size')
24 | flags.DEFINE_bool('debug', True, 'run in debug mode - use subset of the data')
25 | flags.DEFINE_integer('debug_data_size', 50, 'subset data size to test in debug mode')
26 |
27 | # statistics parameters
28 | flags.DEFINE_float('max_error', 0.08, 'error threshold to be considered as failure')
29 | flags.DEFINE_bool('save_log', True, 'save statistics to log_dir')
30 | flags.DEFINE_string('log_path', 'logs/nme_statistics', 'direcotory for saving NME statistics')
31 |
32 | FLAGS = flags.FLAGS
33 |
34 |
35 | def main(_):
36 |
37 | # create directories if not exist
38 | if not tf.gfile.Exists(FLAGS.log_path):
39 | tf.gfile.MakeDirs(FLAGS.log_path)
40 |
41 | test_model_dirs = glob(os.path.join(FLAGS.models_dir, '*/'))
42 |
43 | model_names = []
44 | model_errors = []
45 |
46 | for i, model_dir in enumerate(test_model_dirs):
47 |
48 | model_name = model_dir.split('/')[-2]
49 |
50 | if 'primary' in model_name.lower():
51 | net_type = 'Primary'
52 | elif 'fusion' in model_name.lower():
53 | net_type = 'Fusion'
54 | else:
55 | sys.exit('\n*** Error: please give informative names for model directories, including network type! ***')
56 |
57 | model_path = glob(os.path.join(model_dir, '*meta'))[0].split('.meta')[0]
58 |
59 | print ('\n##### EVALUATING MODELS (%d/%d) #####' % (i+1,len(test_model_dirs)))
60 |
61 | tf.reset_default_graph() # reset graph
62 |
63 | err = evaluate_heatmap_network(
64 | model_path=model_path, network_type=net_type, img_path=FLAGS.img_dir, test_data=FLAGS.test_data,
65 | batch_size=FLAGS.batch_size, image_size=FLAGS.image_size, margin=FLAGS.margin,
66 | bb_type=FLAGS.bb_type, c_dim=FLAGS.c_dim, scale=FLAGS.scale, num_landmarks=FLAGS.num_landmarks,
67 | debug=FLAGS.debug, debug_data_size=FLAGS.debug_data_size)
68 |
69 | print_nme_statistics(
70 | errors=err, model_path=model_path, network_type=net_type, test_data=FLAGS.test_data,
71 | max_error=FLAGS.max_error, save_log=False, log_path=FLAGS.log_path,plot_ced=False)
72 |
73 | model_names.append(model_name)
74 | model_errors.append(err)
75 |
76 | print_ced_compare_methods(
77 | method_errors=tuple(model_errors),method_names=tuple(model_names), test_data=FLAGS.test_data,
78 | log_path=FLAGS.log_path, save_log=FLAGS.save_log)
79 |
80 |
81 | if __name__ == '__main__':
82 | tf.app.run()
83 |
--------------------------------------------------------------------------------
/old/eval_scripts/evaluate_model.py:
--------------------------------------------------------------------------------
1 | from evaluation_functions import *
2 |
3 | flags = tf.app.flags
4 |
5 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
6 | model_path = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/tests/primary/old/no_flip/basic/' \
7 | 'tests_lr_primary_basic_no_flip/0.01/model/deep_heatmaps-80000'
8 |
9 | # define paths
10 | flags.DEFINE_string('img_dir', data_dir, 'data directory')
11 | flags.DEFINE_string('test_data', 'test', 'test set to use full/common/challenging/test/art')
12 | flags.DEFINE_string('model_path', model_path, 'model path')
13 |
14 | # parameters used to train network
15 | flags.DEFINE_string('network_type', 'Primary', 'network architecture Fusion/Primary')
16 | flags.DEFINE_integer('image_size', 256, 'image size')
17 | flags.DEFINE_integer('c_dim', 3, 'color channels')
18 | flags.DEFINE_integer('num_landmarks', 68, 'number of face landmarks')
19 | flags.DEFINE_integer('scale', 1, 'scale for image normalization 255/1/0')
20 | flags.DEFINE_float('margin', 0.25, 'margin for face crops - % of bb size')
21 | flags.DEFINE_string('bb_type', 'gt', "bb to use - 'gt':for ground truth / 'init':for face detector output")
22 |
23 | # choose batch size and debug data size
24 | flags.DEFINE_integer('batch_size', 2, 'batch size')
25 | flags.DEFINE_bool('debug', True, 'run in debug mode - use subset of the data')
26 | flags.DEFINE_integer('debug_data_size', 4, 'subset data size to test in debug mode')
27 |
28 | # statistics parameters
29 | flags.DEFINE_float('max_error', 0.08, 'error threshold to be considered as failure')
30 | flags.DEFINE_bool('save_log', True, 'save statistics to log_dir')
31 | flags.DEFINE_string('log_path', 'logs/nme_statistics', 'directory for saving NME statistics')
32 |
33 | FLAGS = flags.FLAGS
34 |
35 |
36 | def main(_):
37 |
38 | # create directories if not exist
39 | if not tf.gfile.Exists(FLAGS.log_path):
40 | tf.gfile.MakeDirs(FLAGS.log_path)
41 |
42 | err = evaluate_heatmap_network(
43 | model_path=FLAGS.model_path, network_type=FLAGS.network_type, img_path=FLAGS.img_dir,
44 | test_data=FLAGS.test_data, batch_size=FLAGS.batch_size, image_size=FLAGS.image_size, margin=FLAGS.margin,
45 | bb_type=FLAGS.bb_type, c_dim=FLAGS.c_dim, scale=FLAGS.scale, num_landmarks=FLAGS.num_landmarks,
46 | debug=FLAGS.debug, debug_data_size=FLAGS.debug_data_size)
47 |
48 | print_nme_statistics(
49 | errors=err, model_path=FLAGS.model_path, network_type=FLAGS.network_type, test_data=FLAGS.test_data,
50 | max_error=FLAGS.max_error, save_log=FLAGS.save_log, log_path=FLAGS.log_path)
51 |
52 |
53 | if __name__ == '__main__':
54 | tf.app.run()
55 |
--------------------------------------------------------------------------------
/old/eval_scripts/evaluate_models.py:
--------------------------------------------------------------------------------
1 | from evaluation_functions import *
2 | from glob import glob
3 |
4 | flags = tf.app.flags
5 |
6 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
7 | models_dir = 'tests_fusion'
8 | pre_train_model_name = 'deep_heatmaps-50000'
9 | datasets=['full','common','challenging','test']
10 |
11 | # define paths
12 | flags.DEFINE_string('img_dir', data_dir, 'data directory')
13 | flags.DEFINE_string('models_dir', models_dir, 'directory containing multiple models to evaluate')
14 | flags.DEFINE_string('model_name', pre_train_model_name, "model name. e.g: 'deep_heatmaps-50000'")
15 |
16 |
17 | # parameters used to train network
18 | flags.DEFINE_string('network_type', 'Primary', 'network architecture Fusion/Primary')
19 | flags.DEFINE_integer('image_size', 256, 'image size')
20 | flags.DEFINE_integer('c_dim', 3, 'color channels')
21 | flags.DEFINE_integer('num_landmarks', 68, 'number of face landmarks')
22 | flags.DEFINE_integer('scale', 1, 'scale for image normalization 255/1/0')
23 | flags.DEFINE_float('margin', 0.25, 'margin for face crops - % of bb size')
24 | flags.DEFINE_string('bb_type', 'gt', "bb to use - 'gt':for ground truth / 'init':for face detector output")
25 |
26 | # choose batch size and debug data size
27 | flags.DEFINE_integer('batch_size', 2, 'batch size')
28 | flags.DEFINE_bool('debug', False, 'run in debug mode - use subset of the data')
29 | flags.DEFINE_integer('debug_data_size', 4, 'subset data size to test in debug mode')
30 |
31 | # statistics parameters
32 | flags.DEFINE_float('max_error', 0.08, 'error threshold to be considered as failure')
33 | flags.DEFINE_bool('save_log', True, 'save statistics to log_dir')
34 | flags.DEFINE_string('log_path', 'logs/nme_statistics', 'directory for saving NME statistics')
35 |
36 | FLAGS = flags.FLAGS
37 |
38 |
39 | def main(_):
40 | model_dirs = glob(os.path.join(FLAGS.models_dir,'*/'))
41 |
42 | for test_data in datasets:
43 | model_errors=[]
44 | model_names=[]
45 |
46 | for i, model_dir in enumerate(model_dirs):
47 | print ('\n##### EVALUATING MODELS ON '+test_data+' set (%d/%d) #####' % (i + 1, len(model_dirs)))
48 | # create directories if not exist
49 | log_path = os.path.join(model_dir,'logs/nme_statistics')
50 | if not os.path.exists(os.path.join(model_dir,'logs')):
51 | os.mkdir(os.path.join(model_dir,'logs'))
52 | if not os.path.exists(log_path):
53 | os.mkdir(log_path)
54 |
55 | model_name = model_dir.split('/')[-2]
56 |
57 | tf.reset_default_graph() # reset graph
58 |
59 | err = evaluate_heatmap_network(
60 | model_path=os.path.join(model_dir,'model',FLAGS.model_name), network_type=FLAGS.network_type,
61 | img_path=FLAGS.img_dir, test_data=test_data, batch_size=FLAGS.batch_size, image_size=FLAGS.image_size,
62 | margin=FLAGS.margin, bb_type=FLAGS.bb_type, c_dim=FLAGS.c_dim, scale=FLAGS.scale,
63 | num_landmarks=FLAGS.num_landmarks, debug=FLAGS.debug, debug_data_size=FLAGS.debug_data_size)
64 |
65 | print_nme_statistics(
66 | errors=err, model_path=os.path.join(model_dir,'model', FLAGS.model_name),
67 | network_type=FLAGS.network_type, test_data=test_data, max_error=FLAGS.max_error,
68 | save_log=FLAGS.save_log, log_path=log_path, plot_ced=False)
69 |
70 | model_names.append(model_name)
71 | model_errors.append(err)
72 |
73 | print_ced_compare_methods(
74 | method_errors=tuple(model_errors), method_names=tuple(model_names), test_data=test_data,
75 | log_path=FLAGS.models_dir, save_log=FLAGS.save_log)
76 |
77 |
78 | if __name__ == '__main__':
79 | tf.app.run()
80 |
--------------------------------------------------------------------------------
/old/main.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | from deep_heatmaps_model_primary_valid import DeepHeatmapsModel
3 |
4 | # data_dir ='/mnt/External1/Yarden/deep_face_heatmaps/data/conventional_landmark_detection_dataset/'
5 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
6 | pre_train_path = 'saved_models/0.01/model/deep_heatmaps-50000'
7 |
8 | flags = tf.app.flags
9 | flags.DEFINE_string('mode', 'TRAIN', "'TRAIN' or 'TEST'")
10 | flags.DEFINE_string('save_model_path', 'model', "directory for saving the model")
11 | flags.DEFINE_string('save_sample_path', 'sample', "directory for saving the sampled images")
12 | flags.DEFINE_string('save_log_path', 'logs', "directory for saving the log file")
13 | flags.DEFINE_string('img_path', data_dir, "data directory")
14 | flags.DEFINE_string('test_model_path', 'model/deep_heatmaps-5', 'saved model to test')
15 | flags.DEFINE_string('test_data', 'full', 'dataset to test: full/common/challenging/test/art')
16 | flags.DEFINE_string('pre_train_path', pre_train_path, 'pretrained model path')
17 |
18 | FLAGS = flags.FLAGS
19 |
20 |
21 | def main(_):
22 |
23 | # create directories if not exist
24 | if not tf.gfile.Exists(FLAGS.save_model_path):
25 | tf.gfile.MakeDirs(FLAGS.save_model_path)
26 | if not tf.gfile.Exists(FLAGS.save_sample_path):
27 | tf.gfile.MakeDirs(FLAGS.save_sample_path)
28 | if not tf.gfile.Exists(FLAGS.save_log_path):
29 | tf.gfile.MakeDirs(FLAGS.save_log_path)
30 |
31 | model = DeepHeatmapsModel(mode=FLAGS.mode, train_iter=80000, learning_rate=1e-11, momentum=0.95, step=80000,
32 | gamma=0.1, batch_size=4, image_size=256, c_dim=3, num_landmarks=68,
33 | augment_basic=True, basic_start=1, augment_texture=True, p_texture=0.,
34 | augment_geom=True, p_geom=0., artistic_start=2, artistic_step=1,
35 | img_path=FLAGS.img_path, save_log_path=FLAGS.save_log_path,
36 | save_sample_path=FLAGS.save_sample_path, save_model_path=FLAGS.save_model_path,
37 | test_data=FLAGS.test_data, test_model_path=FLAGS.test_model_path,
38 | load_pretrain=False, pre_train_path=FLAGS.pre_train_path)
39 |
40 | if FLAGS.mode == 'TRAIN':
41 | model.train()
42 | else:
43 | model.eval()
44 |
45 | if __name__ == '__main__':
46 | tf.app.run()
47 |
--------------------------------------------------------------------------------
/old/main_fusion_server.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | from deep_heatmaps_model_primary_fusion import DeepHeatmapsModel
3 | import os
4 |
5 | # data_dir ='/mnt/External1/Yarden/deep_face_heatmaps/data/conventional_landmark_detection_dataset/'
6 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
7 | pre_train_path = 'saved_models/0.01/model/deep_heatmaps-50000'
8 | output_dir = os.getcwd()
9 |
10 | flags = tf.app.flags
11 |
12 | flags.DEFINE_string('mode', 'TRAIN', "'TRAIN' or 'TEST'")
13 |
14 | # define paths
15 | flags.DEFINE_string('save_model_path', 'model', "directory for saving the model")
16 | flags.DEFINE_string('save_sample_path', 'sample', "directory for saving the sampled images")
17 | flags.DEFINE_string('save_log_path', 'logs', "directory for saving the log file")
18 | flags.DEFINE_string('img_path', data_dir, "data directory")
19 | flags.DEFINE_string('test_model_path', 'model/deep_heatmaps-5', "saved model to test")
20 | flags.DEFINE_string('test_data','full', 'test set to use full/common/challenging/test/art')
21 |
22 | # pretrain parameters
23 | flags.DEFINE_string('pre_train_path', pre_train_path, 'pretrained model path')
24 | flags.DEFINE_bool('load_pretrain', False, "load pretrained weight?")
25 | flags.DEFINE_bool('load_primary_only', True, "load primary weight only?")
26 |
27 | flags.DEFINE_integer('image_size', 256, "image size")
28 | flags.DEFINE_integer('c_dim', 3, "color channels")
29 | flags.DEFINE_integer('num_landmarks', 68, "number of face landmarks")
30 |
31 | # optimization parameters
32 | flags.DEFINE_integer('train_iter', 100000, 'maximum training iterations')
33 | flags.DEFINE_integer('batch_size', 10, "batch_size")
34 | flags.DEFINE_float('learning_rate', 1e-6, "initial learning rate")
35 | flags.DEFINE_float('momentum', 0.95, 'optimizer momentum')
36 | flags.DEFINE_integer('step', 100000, 'step for lr decay')
37 | flags.DEFINE_float('gamma', 0.1, 'exponential base for lr decay')
38 |
39 | # augmentation parameters
40 | flags.DEFINE_bool('augment_basic', True,"use basic augmentation?")
41 | flags.DEFINE_bool('augment_texture', False,"use artistic texture augmentation?")
42 | flags.DEFINE_bool('augment_geom', False,"use artistic geometric augmentation?")
43 | flags.DEFINE_integer('basic_start', 0, 'min epoch to start basic augmentation')
44 | flags.DEFINE_float('p_texture', 0., 'initial probability of artistic texture augmentation')
45 | flags.DEFINE_float('p_geom', 0., 'initial probability of artistic geometric augmentation')
46 | flags.DEFINE_integer('artistic_step', 10, 'increase probability of artistic augmentation every X epochs')
47 | flags.DEFINE_integer('artistic_start', 0, 'min epoch to start artistic augmentation')
48 |
49 |
50 | # directory of test
51 | flags.DEFINE_string('output_dir', output_dir, "directory for saving test")
52 |
53 | FLAGS = flags.FLAGS
54 |
55 | if not os.path.exists(FLAGS.output_dir):
56 | os.mkdir(FLAGS.output_dir)
57 |
58 |
59 | def main(_):
60 |
61 | save_model_path = os.path.join(FLAGS.output_dir, FLAGS.save_model_path)
62 | save_sample_path = os.path.join(FLAGS.output_dir, FLAGS.save_sample_path)
63 | save_log_path = os.path.join(FLAGS.output_dir, FLAGS.save_log_path)
64 |
65 | # create directories if not exist
66 | if not os.path.exists(save_model_path):
67 | os.mkdir(save_model_path)
68 | if not os.path.exists(save_sample_path):
69 | os.mkdir(save_sample_path)
70 | if not os.path.exists(save_log_path):
71 | os.mkdir(save_log_path)
72 |
73 | model = DeepHeatmapsModel(mode=FLAGS.mode, train_iter=FLAGS.train_iter, learning_rate=FLAGS.learning_rate,
74 | momentum=FLAGS.momentum, step=FLAGS.step, gamma=FLAGS.gamma, batch_size=FLAGS.batch_size,
75 | image_size=FLAGS.image_size, c_dim=FLAGS.c_dim, num_landmarks=FLAGS.num_landmarks,
76 | augment_basic=FLAGS.augment_basic, basic_start=FLAGS.basic_start,
77 | augment_texture=FLAGS.augment_texture, p_texture=FLAGS.p_texture,
78 | augment_geom=FLAGS.augment_geom, p_geom=FLAGS.p_geom,
79 | artistic_start=FLAGS.artistic_start, artistic_step=FLAGS.artistic_step,
80 | img_path=FLAGS.img_path, save_log_path=save_log_path,
81 | save_sample_path=save_sample_path, save_model_path=save_model_path,
82 | test_data=FLAGS.test_data, test_model_path=FLAGS.test_model_path,
83 | load_pretrain=FLAGS.load_pretrain, load_primary_only=FLAGS.load_primary_only,
84 | pre_train_path=FLAGS.pre_train_path)
85 |
86 | if FLAGS.mode == 'TRAIN':
87 | model.train()
88 | else:
89 | model.eval()
90 |
91 | if __name__ == '__main__':
92 | tf.app.run()
93 |
--------------------------------------------------------------------------------
/old/main_primary_server.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | from deep_heatmaps_model_primary_valid import DeepHeatmapsModel
3 | import os
4 |
5 | # data_dir ='/mnt/External1/Yarden/deep_face_heatmaps/data/conventional_landmark_detection_dataset/'
6 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
7 | pre_train_path = 'saved_models/0.01/model/deep_heatmaps-50000'
8 | output_dir = os.getcwd()
9 |
10 | flags = tf.app.flags
11 |
12 | flags.DEFINE_string('mode', 'TRAIN', "'TRAIN' or 'TEST'")
13 |
14 | # define paths
15 | flags.DEFINE_string('save_model_path', 'model', "directory for saving the model")
16 | flags.DEFINE_string('save_sample_path', 'sample', "directory for saving the sampled images")
17 | flags.DEFINE_string('save_log_path', 'logs', "directory for saving the log file")
18 | flags.DEFINE_string('img_path', data_dir, "data directory")
19 | flags.DEFINE_string('test_model_path', 'model/deep_heatmaps-5', "saved model to test")
20 | flags.DEFINE_string('test_data','full', 'test set to use full/common/challenging/test/art')
21 |
22 | # pretrain parameters
23 | flags.DEFINE_string('pre_train_path', pre_train_path, 'pretrained model path')
24 | flags.DEFINE_bool('load_pretrain', False, "load pretrained weight?")
25 |
26 | flags.DEFINE_integer('image_size', 256, "image size")
27 | flags.DEFINE_integer('c_dim', 3, "color channels")
28 | flags.DEFINE_integer('num_landmarks', 68, "number of face landmarks")
29 |
30 | # optimization parameters
31 | flags.DEFINE_integer('train_iter', 100000, 'maximum training iterations')
32 | flags.DEFINE_integer('batch_size', 10, "batch_size")
33 | flags.DEFINE_float('learning_rate', 1e-6, "initial learning rate")
34 | flags.DEFINE_float('momentum', 0.95, 'optimizer momentum')
35 | flags.DEFINE_integer('step', 100000, 'step for lr decay')
36 | flags.DEFINE_float('gamma', 0.1, 'exponential base for lr decay')
37 |
38 | # augmentation parameters
39 | flags.DEFINE_bool('augment_basic', True,"use basic augmentation?")
40 | flags.DEFINE_bool('augment_texture', False,"use artistic texture augmentation?")
41 | flags.DEFINE_bool('augment_geom', False,"use artistic geometric augmentation?")
42 | flags.DEFINE_integer('basic_start', 0, 'min epoch to start basic augmentation')
43 | flags.DEFINE_float('p_texture', 0., 'initial probability of artistic texture augmentation')
44 | flags.DEFINE_float('p_geom', 0., 'initial probability of artistic geometric augmentation')
45 | flags.DEFINE_integer('artistic_step', 10, 'increase probability of artistic augmentation every X epochs')
46 | flags.DEFINE_integer('artistic_start', 0, 'min epoch to start artistic augmentation')
47 |
48 | # directory of test
49 | flags.DEFINE_string('output_dir', output_dir, "directory for saving test")
50 |
51 | FLAGS = flags.FLAGS
52 |
53 | if not os.path.exists(FLAGS.output_dir):
54 | os.mkdir(FLAGS.output_dir)
55 |
56 |
57 | def main(_):
58 |
59 | save_model_path = os.path.join(FLAGS.output_dir, FLAGS.save_model_path)
60 | save_sample_path = os.path.join(FLAGS.output_dir, FLAGS.save_sample_path)
61 | save_log_path = os.path.join(FLAGS.output_dir, FLAGS.save_log_path)
62 |
63 | # create directories if not exist
64 | if not os.path.exists(save_model_path):
65 | os.mkdir(save_model_path)
66 | if not os.path.exists(save_sample_path):
67 | os.mkdir(save_sample_path)
68 | if not os.path.exists(save_log_path):
69 | os.mkdir(save_log_path)
70 |
71 | model = DeepHeatmapsModel(mode=FLAGS.mode, train_iter=FLAGS.train_iter, learning_rate=FLAGS.learning_rate,
72 | momentum=FLAGS.momentum, step=FLAGS.step, gamma=FLAGS.gamma, batch_size=FLAGS.batch_size,
73 | image_size=FLAGS.image_size, c_dim=FLAGS.c_dim, num_landmarks=FLAGS.num_landmarks,
74 | augment_basic=FLAGS.augment_basic, basic_start=FLAGS.basic_start,
75 | augment_texture=FLAGS.augment_texture, p_texture=FLAGS.p_texture,
76 | augment_geom=FLAGS.augment_geom, p_geom=FLAGS.p_geom,
77 | artistic_start=FLAGS.artistic_start, artistic_step=FLAGS.artistic_step,
78 | img_path=FLAGS.img_path, save_log_path=save_log_path,
79 | save_sample_path=save_sample_path, save_model_path=save_model_path,
80 | test_data=FLAGS.test_data, test_model_path=FLAGS.test_model_path,
81 | load_pretrain=FLAGS.load_pretrain, pre_train_path=FLAGS.pre_train_path)
82 |
83 | if FLAGS.mode == 'TRAIN':
84 | model.train()
85 | else:
86 | model.eval()
87 |
88 | if __name__ == '__main__':
89 | tf.app.run()
90 |
--------------------------------------------------------------------------------
/old/run_tests_template.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | from deep_heatmaps_model_primary_valid import DeepHeatmapsModel
3 | import os
4 | import numpy as np
5 |
6 | num_tests = 10
7 | params = np.logspace(-8, -2, num_tests)
8 | max_iter = 80000
9 |
10 | output_dir = 'tests_lr_fusion'
11 | data_dir = '../conventional_landmark_detection_dataset'
12 |
13 | flags = tf.app.flags
14 | flags.DEFINE_string('output_dir', output_dir, "directory for saving the log file")
15 | flags.DEFINE_string('img_path', data_dir, "data directory")
16 | FLAGS = flags.FLAGS
17 |
18 | if not os.path.exists(FLAGS.output_dir):
19 | os.mkdir(FLAGS.output_dir)
20 |
21 | for param in params:
22 | test_name = str(param)
23 | test_dir = os.path.join(FLAGS.output_dir,test_name)
24 | if not os.path.exists(test_dir):
25 | os.mkdir(test_dir)
26 |
27 | print '##### RUNNING TESTS ##### current directory:', test_dir
28 |
29 | save_model_path = os.path.join(test_dir, 'model')
30 | save_sample_path = os.path.join(test_dir, 'sample')
31 | save_log_path = os.path.join(test_dir, 'logs')
32 |
33 | # create directories if not exist
34 | if not os.path.exists(save_model_path):
35 | os.mkdir(save_model_path)
36 | if not os.path.exists(save_sample_path):
37 | os.mkdir(save_sample_path)
38 | if not os.path.exists(save_log_path):
39 | os.mkdir(save_log_path)
40 |
41 | tf.reset_default_graph() # reset graph
42 |
43 | model = DeepHeatmapsModel(mode='TRAIN', train_iter=max_iter, learning_rate=param, momentum=0.95, step=80000,
44 | gamma=0.1, batch_size=4, image_size=256, c_dim=3, num_landmarks=68,
45 | augment_basic=True, basic_start=0, augment_texture=True, p_texture=0.5,
46 | augment_geom=True, p_geom=0.5, artistic_start=0, artistic_step=10,
47 | img_path=FLAGS.img_path, save_log_path=save_log_path, save_sample_path=save_sample_path,
48 | save_model_path=save_model_path)
49 |
50 | model.train()
51 |
--------------------------------------------------------------------------------
/old/teaser.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/papulke/face-of-art/ffa62a579cc8bc389e2088923736c4947a1fad70/old/teaser.png
--------------------------------------------------------------------------------
/old/temp/Untitled.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470
2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3 | {\colortbl;\red255\green255\blue255;}
4 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
6 |
7 | \f0\fs24 \cf0 a}
--------------------------------------------------------------------------------
/old/temp/create_art_data.py:
--------------------------------------------------------------------------------
1 | from create_art_data_functions import *
2 | from scipy.misc import imsave
3 | import sys
4 |
5 |
6 | '''THIS SCRIPT CREATES PRE-AUGMENTED DATA TO SAVE TRAINING TIME (ARTISTIC OR BASIC AUGMENTATION):
7 | under the folder *outdir*, it will create a separate folder for each epoch. the folder will
8 | contain the augmented images and matching landmark (pts) files.'''
9 |
10 | # parameter for calculating number of epochs
11 | num_train_images = 3148 # number of training images
12 | train_iter = 100000 # number of training iterations
13 | batch_size = 6 # batch size in training
14 | num_epochs = int(np.ceil((1. * train_iter) / (1. * num_train_images / batch_size)))+1
15 |
16 | # augmentation parameters
17 | num_augs = 9 # number of style transfer augmented images
18 | aug_geom = True # use artistic geometric augmentation?
19 | aug_texture = True # use artistic texture augmentation?
20 |
21 | # image parameters
22 | bb_type = 'gt' # face bounding-box type (gt/init)
23 | margin = 0.25 # margin for face crops - % of bb size
24 | image_size = 256 # image size
25 |
26 | # data-sets image paths
27 | dataset = 'training' # dataset to augment (training/full/common/challenging/test)
28 | img_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
29 | train_crop_dir = 'crop_gt_margin_0.25' # directory of train images cropped to bb (+margin)
30 | img_dir_ns = os.path.join(img_dir, train_crop_dir+'_ns') # dir of train imgs cropped to bb + style transfer
31 | outdir = '/Users/arik/Desktop/epoch_data' # directory for saving augmented data
32 |
33 | # other parameters
34 | min_epoch_to_save = 0 # start saving images from this epoch (first epoch is 0)
35 | debug_data_size = 15
36 | debug = False
37 | random_seed = 1234 # random seed for numpy
38 |
39 | ########################################################################################
40 | if aug_texture and img_dir_ns is None:
41 | print('\n *** ERROR: aug_texture is True, and img_dir_ns is None.\n'
42 | 'please specify path for img_dir_ns to augment image texture!')
43 | sys.exit()
44 |
45 | if not os.path.exists(outdir):
46 | os.mkdir(outdir)
47 |
48 | gt = (bb_type == 'gt')
49 | bb_dir = os.path.join(img_dir, 'Bounding_Boxes')
50 |
51 | if dataset == 'training':
52 | mode = 'TRAIN'
53 | else:
54 | mode = 'TEST'
55 | bb_dictionary = load_bb_dictionary(bb_dir, mode=mode, test_data=dataset)
56 |
57 | aug_geom_dir = os.path.join(outdir, 'aug_geom')
58 | aug_texture_dir = os.path.join(outdir, 'aug_texture')
59 | aug_geom_texture_dir = os.path.join(outdir, 'aug_geom_texture')
60 | aug_basic_dir = os.path.join(outdir, 'aug_basic')
61 |
62 | if not aug_geom and aug_texture:
63 | save_aug_path = aug_texture_dir
64 | elif aug_geom and not aug_texture:
65 | save_aug_path = aug_geom_dir
66 | elif aug_geom and aug_texture:
67 | save_aug_path = aug_geom_texture_dir
68 | else:
69 | save_aug_path = aug_basic_dir
70 |
71 | print ('saving augmented images: aug_geom=' + str(aug_geom) + ' aug_texture=' + str(aug_texture) +
72 | ' : ' + str(save_aug_path))
73 |
74 | if not os.path.exists(save_aug_path):
75 | os.mkdir(save_aug_path)
76 |
77 | np.random.seed(random_seed)
78 | ns_inds = np.arange(num_augs)
79 |
80 | for i in range(num_epochs):
81 | print ('saving augmented images of epoch %d/%d' % (i, num_epochs-1))
82 | if not os.path.exists(os.path.join(save_aug_path, str(i))) and i > min_epoch_to_save - 1:
83 | os.mkdir(os.path.join(save_aug_path, str(i)))
84 |
85 | if i % num_augs == 0:
86 | np.random.shuffle(ns_inds)
87 |
88 | if not aug_geom and aug_texture:
89 | img_list = load_menpo_image_list_no_geom(
90 | img_dir=img_dir, train_crop_dir=train_crop_dir, img_dir_ns=img_dir_ns, mode='TRAIN',
91 | bb_dictionary=bb_dictionary,
92 | image_size=image_size, margin=margin, bb_type=bb_type, augment_basic=True,
93 | augment_texture=True, p_texture=1.,
94 | augment_geom=True, p_geom=1., ns_ind=ns_inds[i % num_augs], dataset=dataset)
95 | elif aug_geom and not aug_texture:
96 | img_list = load_menpo_image_list_no_texture(
97 | img_dir=img_dir, train_crop_dir=train_crop_dir, img_dir_ns=img_dir_ns, mode='TRAIN',
98 | bb_dictionary=bb_dictionary,
99 | image_size=image_size, margin=margin, bb_type=bb_type, augment_basic=True,
100 | augment_texture=True, p_texture=1.,
101 | augment_geom=True, p_geom=1., ns_ind=ns_inds[i % num_augs], dataset=dataset)
102 | elif aug_geom and aug_texture:
103 | img_list = load_menpo_image_list(
104 | img_dir=img_dir, train_crop_dir=train_crop_dir, img_dir_ns=img_dir_ns, mode='TRAIN',
105 | bb_dictionary=bb_dictionary,
106 | image_size=image_size, margin=margin, bb_type=bb_type, augment_basic=True,
107 | augment_texture=True, p_texture=1.,
108 | augment_geom=True, p_geom=1., ns_ind=ns_inds[i % num_augs], dataset=dataset)
109 | else:
110 | img_list = load_menpo_image_list_no_artistic(
111 | img_dir=img_dir, train_crop_dir=train_crop_dir, img_dir_ns=img_dir_ns, mode='TRAIN',
112 | bb_dictionary=bb_dictionary,
113 | image_size=image_size, margin=margin, bb_type=bb_type, augment_basic=True,
114 | augment_texture=True, p_texture=1.,
115 | augment_geom=True, p_geom=1., ns_ind=ns_inds[i % num_augs], dataset=dataset)
116 |
117 | if debug:
118 | img_list = img_list[:debug_data_size]
119 |
120 | for im in img_list:
121 | im_path = os.path.join(save_aug_path, str(i), im.path.name.split('.')[0] + '.png')
122 | pts_path = os.path.join(save_aug_path, str(i), im.path.name.split('.')[0] + '.pts')
123 | if i > min_epoch_to_save - 1:
124 | if not os.path.exists(im_path):
125 | if im.pixels.shape[0] == 1:
126 | im_pixels = gray2rgb(np.squeeze(im.pixels))
127 | else:
128 | im_pixels = np.rollaxis(im.pixels, 0, 3)
129 | imsave(im_path, im_pixels)
130 | if not os.path.exists(pts_path):
131 | mio.export_landmark_file(im.landmarks['PTS'], pts_path, overwrite=True)
132 | print ('DONE!')
--------------------------------------------------------------------------------
/old/temp/predict_landmarks.py:
--------------------------------------------------------------------------------
1 | from menpo_functions import *
2 | from deep_heatmaps_model_fusion_net import DeepHeatmapsModel
3 | import os
4 | import pickle
5 |
6 | # directory for saving predictions
7 | out_dir = '/Users/arik/Desktop/out/'
8 | if not os.path.exists(out_dir):
9 | os.mkdir(out_dir)
10 |
11 | # directory with conventional landmark detection datasets (for bounding box files)
12 | conv_dir = '/Users/arik/Dropbox/a_mac_thesis/face_heatmap_networks/conventional_landmark_detection_dataset/'
13 |
14 | # bounding box type for conventional landmark detection datasets (gt / init)
15 | bb_type='init'
16 |
17 | # directory with clm models for tuning step
18 | clm_path='pdm_clm_models/clm_models/g_t_all'
19 |
20 | # directory with pdm models for correction step
21 | pdm_path='pdm_clm_models/pdm_models/'
22 |
23 | # model path
24 | model_path = '/Users/arik/Dropbox/Thesis_dropbox/models/model_train_wiki/model/deep_heatmaps-60000'
25 |
26 | # directory containing test sets
27 | data_dir = '/Users/arik/Dropbox/a_mac_thesis/artistic_faces/artistic_face_dataset/'
28 | test_sets = ['all_AF'] # test sets to evaluate
29 |
30 |
31 | # data_dir = '/Users/arik/Desktop/Thesis_mac/semi_art_sets/semi_art_sets_wiki_train_2/'
32 | # test_sets = [
33 | # 'challenging_set_aug_geom_texture',
34 | # 'common_set_aug_geom_texture',
35 | # 'test_set_aug_geom_texture',
36 | # 'full_set_aug_geom_texture'
37 | # ]
38 |
39 |
40 | # load heatmap model
41 | heatmap_model = DeepHeatmapsModel(
42 | mode='TEST', img_path=conv_dir, test_model_path=model_path, menpo_verbose=False, scale=1)
43 |
44 | bb_dir = os.path.join(conv_dir, 'Bounding_Boxes')
45 |
46 | # predict landmarks for input test sets
47 | for i,test_data in enumerate(test_sets):
48 |
49 | if i == 0:
50 | reuse=None
51 | else:
52 | reuse=True
53 |
54 | out_temp = os.path.join(out_dir, test_data)
55 | if not os.path.exists(out_temp):
56 | os.mkdir(out_temp)
57 |
58 | bb_dictionary = load_bb_dictionary(bb_dir, mode='TEST', test_data=test_data)
59 |
60 | img_list = load_menpo_image_list(img_dir=data_dir, train_crop_dir=data_dir, img_dir_ns=data_dir, mode='TEST',
61 | test_data=test_data, bb_type=bb_type, bb_dictionary=bb_dictionary)
62 |
63 | img_list = img_list[:10]
64 | print test_data + ':' + str(len(img_list)) + ' images'
65 |
66 | preds = heatmap_model.get_landmark_predictions(img_list=img_list, pdm_models_dir=pdm_path, clm_model_path=clm_path,
67 | reuse=reuse)
68 |
69 | init_lms = preds['E']
70 | ppdm_lms = preds['ECp']
71 | clm_lms = preds['ECpT']
72 | ect_lms = preds['ECT']
73 | ecptp_jaw_lms = preds['ECpTp_jaw']
74 | ecptp_out_lms = preds['ECpTp_out']
75 |
76 | filehandler = open(os.path.join(out_temp,'E_lms'),"wb")
77 | pickle.dump(init_lms,filehandler)
78 | filehandler.close()
79 |
80 | filehandler = open(os.path.join(out_temp,'ECp_lms'),"wb")
81 | pickle.dump(ppdm_lms,filehandler)
82 | filehandler.close()
83 |
84 | filehandler = open(os.path.join(out_temp,'ECpT_lms'),"wb")
85 | pickle.dump(clm_lms,filehandler)
86 | filehandler.close()
87 |
88 | filehandler = open(os.path.join(out_temp,'ECT_lms'),"wb")
89 | pickle.dump(ect_lms,filehandler)
90 | filehandler.close()
91 |
92 | filehandler = open(os.path.join(out_temp,'ECpTp_jaw_lms'),"wb")
93 | pickle.dump(ecptp_jaw_lms,filehandler)
94 | filehandler.close()
95 |
96 | filehandler = open(os.path.join(out_temp,'ECpTp_out_lms'),"wb")
97 | pickle.dump(ecptp_out_lms,filehandler)
98 | filehandler.close()
99 |
100 | print("\nDone!\n")
--------------------------------------------------------------------------------
/ops.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | import numpy as np
3 |
4 |
5 | def conv_relu_pool(input, conv_ker, conv_filters, conv_stride=1, conv_padding='SAME',
6 | conv_ker_init=tf.random_normal_initializer(0.01), conv_bias_init=tf.zeros_initializer(),
7 | pool_size=2, pool_stride=2, pool_padding='same', var_scope='layer', reuse=None):
8 |
9 | with tf.variable_scope(var_scope):
10 | conv = tf.layers.conv2d(input, filters=conv_filters, kernel_size=[conv_ker, conv_ker],
11 | strides=conv_stride, padding=conv_padding, bias_initializer=conv_bias_init,
12 | kernel_initializer=conv_ker_init, name='conv', reuse=reuse)
13 | relu = tf.nn.relu(conv, name='relu')
14 | out = tf.layers.max_pooling2d(relu, pool_size=(pool_size, pool_size),
15 | strides=(pool_stride, pool_stride), padding=pool_padding, name='pool')
16 | return out
17 |
18 |
19 | def conv_relu(input, conv_ker, conv_filters, conv_stride=1, conv_dilation=1, conv_padding='SAME',
20 | conv_ker_init=tf.random_normal_initializer(0.01), conv_bias_init=tf.zeros_initializer(),
21 | var_scope='layer', reuse=None):
22 |
23 | with tf.variable_scope(var_scope):
24 | conv = tf.layers.conv2d(input, filters=conv_filters, kernel_size=[conv_ker, conv_ker],
25 | strides=conv_stride, dilation_rate=conv_dilation, padding=conv_padding,
26 | bias_initializer=conv_bias_init, kernel_initializer=conv_ker_init, name='conv',
27 | reuse=reuse)
28 | out = tf.nn.relu(conv, name='relu')
29 | return out
30 |
31 |
32 | def conv(input, conv_ker, conv_filters, conv_stride=1, conv_dilation=1, conv_padding='SAME',
33 | conv_ker_init=tf.random_normal_initializer(0.01), conv_bias_init=tf.zeros_initializer(),
34 | var_scope='layer', reuse=None):
35 |
36 | with tf.variable_scope(var_scope):
37 | out = tf.layers.conv2d(input, filters=conv_filters, kernel_size=[conv_ker, conv_ker],
38 | strides=conv_stride, dilation_rate=conv_dilation, padding=conv_padding,
39 | bias_initializer=conv_bias_init, kernel_initializer=conv_ker_init, name='conv',
40 | reuse=reuse)
41 | return out
42 |
43 |
44 | def deconv(input, conv_ker, conv_filters, conv_stride=1, conv_padding='SAME',
45 | conv_ker_init=tf.random_normal_initializer(0.01), conv_bias_init=tf.zeros_initializer(),
46 | var_scope='layer', reuse=None):
47 |
48 | with tf.variable_scope(var_scope):
49 | out = tf.layers.conv2d_transpose(input, filters=conv_filters, kernel_size=[conv_ker, conv_ker],
50 | strides=conv_stride, padding=conv_padding, bias_initializer=conv_bias_init,
51 | kernel_initializer=conv_ker_init, name='deconv', reuse=reuse)
52 | return out
53 |
54 |
55 | def deconv2d_bilinear_upsampling_initializer(shape):
56 | """Returns the initializer that can be passed to DeConv2dLayer for initializ ingthe
57 | weights in correspondence to channel-wise bilinear up-sampling.
58 | Used in segmentation approaches such as [FCN](https://arxiv.org/abs/1605.06211)
59 | Parameters
60 | ----------
61 | shape : tuple of int
62 | The shape of the filters, [height, width, output_channels, in_channels].
63 | It must match the shape passed to DeConv2dLayer.
64 | Returns
65 | -------
66 | ``tf.constant_initializer``
67 | A constant initializer with weights set to correspond to per channel bilinear upsampling
68 | when passed as W_int in DeConv2dLayer
69 | --------
70 | from: tensorlayer
71 | https://github.com/tensorlayer/tensorlayer/blob/c7a1a4924219244c71048709ca729aca0c34c453/tensorlayer/layers/convolution.py
72 | """
73 | if shape[0] != shape[1]:
74 | raise Exception('deconv2d_bilinear_upsampling_initializer only supports symmetrical filter sizes')
75 | if shape[3] < shape[2]:
76 | raise Exception('deconv2d_bilinear_upsampling_initializer behaviour is not defined for num_in_channels < num_out_channels ')
77 |
78 | filter_size = shape[0]
79 | num_out_channels = shape[2]
80 | num_in_channels = shape[3]
81 |
82 | # Create bilinear filter kernel as numpy array
83 | bilinear_kernel = np.zeros([filter_size, filter_size], dtype=np.float32)
84 | scale_factor = (filter_size + 1) // 2
85 | if filter_size % 2 == 1:
86 | center = scale_factor - 1
87 | else:
88 | center = scale_factor - 0.5
89 | for x in range(filter_size):
90 | for y in range(filter_size):
91 | bilinear_kernel[x, y] = (1 - abs(x - center) / scale_factor) * \
92 | (1 - abs(y - center) / scale_factor)
93 | weights = np.zeros((filter_size, filter_size, num_out_channels, num_in_channels))
94 | for i in range(num_out_channels):
95 | weights[:, :, i, i] = bilinear_kernel
96 |
97 | # assign numpy array to constant_initalizer and pass to get_variable
98 | bilinear_weights_init = tf.constant_initializer(value=weights, dtype=tf.float32)
99 | return bilinear_weights_init
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/basic_l_brow_2:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I10
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S'\x88\xed\xf6\xaa\xf4#\xc6\xbf\xfc\x1c\x80ID\x7f\xe2?\xee\xdd\xc7H\xb0i\xa9?\x19k\xba\xc0\x026\xd6?\xc7\xa2\xb0,*\x15\xbd?\x93\n\xad\x04\xd1\xf9\x92?M\xf3\xe0\x01\xefp\xb1?9\xba\x11D\x99n\xd4\xbf:T\x0f\xfa\x0f\xe6\xad\xbf\xef\xdd\xf9\x8f\xc7\xfa\xe3\xbf\xfd\x1c\x80ID\x7f\xe2\xbf\x8a\xed\xf6\xaa\xf4#\xc6\xbf\x18k\xba\xc0\x026\xd6\xbf\xf2\xdd\xc7H\xb0i\xa9?\x92\n\xad\x04\xd1\xf9\x92\xbf\xc7\xa2\xb0,*\x15\xbd?9\xba\x11D\x99n\xd4?L\xf3\xe0\x01\xefp\xb1?\xee\xdd\xf9\x8f\xc7\xfa\xe3?@T\x0f\xfa\x0f\xe6\xad\xbf\xf3\xed\xbf\xc5%\x9f\xdc\xbfK\x9c\xbcq\xbe\xcd\xc2\xbc\xe5\xed\xbf\xc5%\x9f\xdc\xbfh\x15\x87\x01\x7f\x8f\x95<\xda\xed\xbf\xc5%\x9f\xdc\xbfg{p\x9fir\xb2<\xcd\xed\xbf\xc5%\x9f\xdc\xbf+\xb8\xeb`}\x9b\xa8<\xc0\xed\xbf\xc5%\x9f\xdc\xbf\x9c/\xcd6\xfc\xfd\x9a\xbc\xffg\xd7]\xdb\x07\xc6<\xef\xed\xbf\xc5%\x9f\xdc\xbf?\x11[\xa0GL\x96<\xea\xed\xbf\xc5%\x9f\xdc\xbf\xc2\xe4n\x91\xe4\x83\xac\xbc\xd8\xed\xbf\xc5%\x9f\xdc\xbf\xb8f\x0c\x0b\x13\x19\xad\xbc\xcd\xed\xbf\xc5%\x9f\xdc\xbf\xc1\x03\xb9\xef\xf0U\x84\xbc\xbe\xed\xbf\xc5%\x9f\xdc\xbf'
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I10
72 | tp31
73 | g22
74 | I00
75 | S':\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0|\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0%;\xfc\xfeGQ,\xc0\x9f \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0iA\x8c\x14\xfb\xe4C@\x12\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@'
76 | p32
77 | tp33
78 | bsS'template_instance'
79 | p34
80 | g0
81 | (cmenpo.shape.pointcloud
82 | PointCloud
83 | p35
84 | g2
85 | Ntp36
86 | Rp37
87 | (dp38
88 | S'points'
89 | p39
90 | g12
91 | (g13
92 | (I0
93 | tp40
94 | g15
95 | tp41
96 | Rp42
97 | (I1
98 | (I5
99 | I2
100 | tp43
101 | g22
102 | I00
103 | S':\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0|\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0%;\xfc\xfeGQ,\xc0\x9f \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0iA\x8c\x14\xfb\xe4C@\x12\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@'
104 | p44
105 | tp45
106 | bsS'_landmarks'
107 | p46
108 | NsbsbsS'similarity_weights'
109 | p47
110 | g12
111 | (g13
112 | (I0
113 | tp48
114 | g15
115 | tp49
116 | Rp50
117 | (I1
118 | (I4
119 | tp51
120 | g22
121 | I00
122 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
123 | p52
124 | tp53
125 | bsS'_weights'
126 | p54
127 | g12
128 | (g13
129 | (I0
130 | tp55
131 | g15
132 | tp56
133 | Rp57
134 | (I1
135 | (I2
136 | tp58
137 | g22
138 | I00
139 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
140 | p59
141 | tp60
142 | bsS'_target'
143 | p61
144 | g0
145 | (g35
146 | g2
147 | Ntp62
148 | Rp63
149 | (dp64
150 | g39
151 | g12
152 | (g13
153 | (I0
154 | tp65
155 | g15
156 | tp66
157 | Rp67
158 | (I1
159 | (I5
160 | I2
161 | tp68
162 | g22
163 | I00
164 | S'4\x0e\xe8\xb4\xd4\x8e5@\xe7\x14\x81\\\xae\x02R\xc0\x86\xa4\xf6\xda\x85\xbe\x18\xc0\x04\x9e\x11/i\xa0E\xc0$;\xfc\xfeGQ,\xc0\x9d \xb8\xab\x01z\x02\xc0\xf6\x94E\xe2u\xfb \xc0jA\x8c\x14\xfb\xe4C@&\x0c\xda\xc9\xae\x1c\x1d@e\x84!w5tS@'
165 | p69
166 | tp70
167 | bsg46
168 | NsbsS'global_transform'
169 | p71
170 | g0
171 | (cmenpofit.transform.homogeneous
172 | DifferentiableAlignmentSimilarity
173 | p72
174 | g2
175 | Ntp73
176 | Rp74
177 | (dp75
178 | S'_h_matrix'
179 | p76
180 | g12
181 | (g13
182 | (I0
183 | tp77
184 | g15
185 | tp78
186 | Rp79
187 | (I1
188 | (I3
189 | I3
190 | tp80
191 | g22
192 | I00
193 | S'\xff\xff\xff\xff\xff\xff\xef?\xa1\xf1\x93\x9a*\xdf\xb0<\x00\x00\x00\x00\x00\x00\x02\xba\xe0B\xefl\xf3\r\x9b\xbc\x01\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00\xba\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?'
194 | p81
195 | tp82
196 | bsg61
197 | g0
198 | (g35
199 | g2
200 | Ntp83
201 | Rp84
202 | (dp85
203 | g39
204 | g12
205 | (g13
206 | (I0
207 | tp86
208 | g15
209 | tp87
210 | Rp88
211 | (I1
212 | (I5
213 | I2
214 | tp89
215 | g22
216 | I00
217 | S':\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0|\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0%;\xfc\xfeGQ,\xc0\x9f \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0iA\x8c\x14\xfb\xe4C@\x12\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@'
218 | p90
219 | tp91
220 | bsg46
221 | NsbsS'allow_mirror'
222 | p92
223 | I00
224 | sS'_source'
225 | p93
226 | g84
227 | sbsS'model'
228 | p94
229 | g0
230 | (cmenpo.model.pca
231 | PCAModel
232 | p95
233 | g2
234 | Ntp96
235 | Rp97
236 | (dp98
237 | S'centred'
238 | p99
239 | I01
240 | sg34
241 | g0
242 | (g35
243 | g2
244 | Ntp100
245 | Rp101
246 | (dp102
247 | g39
248 | g12
249 | (g13
250 | (I0
251 | tp103
252 | g15
253 | tp104
254 | Rp105
255 | (I1
256 | (I5
257 | I2
258 | tp106
259 | g22
260 | I00
261 | S'\xb8^$\x13\xe9\xa1/@\xb9TX\x04`\x9aS\xc0dB\x93\xa1\x9f|\xf3\xbf\xfc@\xbc\xc7&\xd0C\xc0\x82\xb5\x1c\x04p\xb0 \xc0\x87\x83\x88\xa7\xd4\xad\xf7?\xdc\x85\xe4\xf4\xc93!\xc0[H\xd41[PC@\xb7\x13=h\x93\xc7\x02@\x1a/\xae|\x8e{S@'
262 | p107
263 | tp108
264 | bsg46
265 | NsbsS'_eigenvalues'
266 | p109
267 | g12
268 | (g13
269 | (I0
270 | tp110
271 | g15
272 | tp111
273 | Rp112
274 | (I1
275 | (I2
276 | tp113
277 | g22
278 | I00
279 | S'9}\x1f,D\xf3Y@\x19\xec\x02P\xa2G:@'
280 | p114
281 | tp115
282 | bsS'_trimmed_eigenvalues'
283 | p116
284 | g12
285 | (g13
286 | (I0
287 | tp117
288 | g15
289 | tp118
290 | Rp119
291 | (I1
292 | (I5
293 | tp120
294 | g22
295 | I00
296 | S"0\xcdw'\xb3\r$@J\xa0\xa6\x83\x8bD\x17@(\xee\x14\x97\xbb\xd9\x11@:%sQ\xf1a\x05@\x84\x95\xdd\xc5xr\xe6?"
297 | p121
298 | tp122
299 | bsg11
300 | g12
301 | (g13
302 | (I0
303 | tp123
304 | g15
305 | tp124
306 | Rp125
307 | (I1
308 | (I2
309 | I10
310 | tp126
311 | g22
312 | I00
313 | S'\x1e\xdaOz\xa4Q\xde?)t\xdf\x8f\xa9\xa1\xd8?;\x18V\x94@\xa4\xd3\xbf\x81G\x04\xdb\xe6X\xca\xbfY\xd5\x13P\xf2e\xdf\xbf\x8c\x14b\x97\xeeT\xbf\xbfc\xe8\xd6\xb6\x93c\xc1\xbfe\xd9*\x97\xc1^\x90?\x9f\x87\x85EXj\xdd?z\xe3\xddW\x9a\x97\xb2\xbfnc\x0b\x83J[\xc0\xbf\\\x83\xe2b\xdd\x8d\xdb?V\xec\xf9h\x8e\x92\xd3\xbf\x97\xb1s\xf3\xc4;\xd4\xbf\xcaw\xbf8\xc7\x01\xd1?\x99\x97\xb1\xe3\xab\x06\xd5\xbf\t\x13RPa\x0f\xd7?5\xfe\x96~\x80O\xce\xbf\x8a\xd9#\xbd\xe9\xa1\xc8\xbf\xf0D\x8e\xb3S\xdc\xdc?'
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I10
326 | tp132
327 | g22
328 | I00
329 | S':\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0|\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0%;\xfc\xfeGQ,\xc0\x9f \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0iA\x8c\x14\xfb\xe4C@\x12\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@'
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I2
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/basic_l_brow_3:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I10
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S'\x88\xed\xf6\xaa\xf4#\xc6\xbf\xfe\x1c\x80ID\x7f\xe2?\xf2\xdd\xc7H\xb0i\xa9?\x1bk\xba\xc0\x026\xd6?\xcb\xa2\xb0,*\x15\xbd?\x93\n\xad\x04\xd1\xf9\x92?N\xf3\xe0\x01\xefp\xb1?;\xba\x11D\x99n\xd4\xbfCT\x0f\xfa\x0f\xe6\xad\xbf\xf0\xdd\xf9\x8f\xc7\xfa\xe3\xbf\xfe\x1c\x80ID\x7f\xe2\xbf\x84\xed\xf6\xaa\xf4#\xc6\xbf\x17k\xba\xc0\x026\xd6\xbf\xfa\xdd\xc7H\xb0i\xa9?\x88\n\xad\x04\xd1\xf9\x92\xbf\xc7\xa2\xb0,*\x15\xbd?8\xba\x11D\x99n\xd4?G\xf3\xe0\x01\xefp\xb1?\xed\xdd\xf9\x8f\xc7\xfa\xe3?RT\x0f\xfa\x0f\xe6\xad\xbf\xf3\xed\xbf\xc5%\x9f\xdc\xbf\xf8;e\xce\xa5=\xba\xbc\xe4\xed\xbf\xc5%\x9f\xdc\xbf1\x863\xf2\x88\xef\xa1<\xd8\xed\xbf\xc5%\x9f\xdc\xbfg{p\x9fi\xc2\xb1<\xcd\xed\xbf\xc5%\x9f\xdc\xbf\xae\xbc{\xef\xb3s\xa3<\xc2\xed\xbf\xc5%\x9f\xdc\xbfK\x93\xd6\x8c\xc7\xa6\xa4\xbc\xc0/\x8c\xfb\xe3\x90\xc5<\xee\xed\xbf\xc5%\x9f\xdc\xbf]\xb3\x180K`\x83<\xea\xed\xbf\xc5%\x9f\xdc\xbfH\x15O\xda\x8fv\xb0\xbc\xd8\xed\xbf\xc5%\x9f\xdc\xbf!\xbbS\x82\xb5X\xac\xbc\xcd\xed\xbf\xc5%\x9f\xdc\xbfa1\xa0P\x1eT\x7f\xbc\xbe\xed\xbf\xc5%\x9f\xdc\xbf'
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I10
72 | tp31
73 | g22
74 | I00
75 | S"7\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0~\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0';\xfc\xfeGQ,\xc0\x9e \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0jA\x8c\x14\xfb\xe4C@\x19\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@"
76 | p32
77 | tp33
78 | bsS'template_instance'
79 | p34
80 | g0
81 | (cmenpo.shape.pointcloud
82 | PointCloud
83 | p35
84 | g2
85 | Ntp36
86 | Rp37
87 | (dp38
88 | S'points'
89 | p39
90 | g12
91 | (g13
92 | (I0
93 | tp40
94 | g15
95 | tp41
96 | Rp42
97 | (I1
98 | (I5
99 | I2
100 | tp43
101 | g22
102 | I00
103 | S"7\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0~\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0';\xfc\xfeGQ,\xc0\x9e \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0jA\x8c\x14\xfb\xe4C@\x19\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@"
104 | p44
105 | tp45
106 | bsS'_landmarks'
107 | p46
108 | NsbsbsS'similarity_weights'
109 | p47
110 | g12
111 | (g13
112 | (I0
113 | tp48
114 | g15
115 | tp49
116 | Rp50
117 | (I1
118 | (I4
119 | tp51
120 | g22
121 | I00
122 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
123 | p52
124 | tp53
125 | bsS'_weights'
126 | p54
127 | g12
128 | (g13
129 | (I0
130 | tp55
131 | g15
132 | tp56
133 | Rp57
134 | (I1
135 | (I3
136 | tp58
137 | g22
138 | I00
139 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
140 | p59
141 | tp60
142 | bsS'_target'
143 | p61
144 | g0
145 | (g35
146 | g2
147 | Ntp62
148 | Rp63
149 | (dp64
150 | g39
151 | g12
152 | (g13
153 | (I0
154 | tp65
155 | g15
156 | tp66
157 | Rp67
158 | (I1
159 | (I5
160 | I2
161 | tp68
162 | g22
163 | I00
164 | S'=\x0e\xe8\xb4\xd4\x8e5@\xe7\x14\x81\\\xae\x02R\xc0z\xa4\xf6\xda\x85\xbe\x18\xc0\x04\x9e\x11/i\xa0E\xc0+;\xfc\xfeGQ,\xc0\x9a \xb8\xab\x01z\x02\xc0\x01\x95E\xe2u\xfb \xc0kA\x8c\x14\xfb\xe4C@\x11\x0c\xda\xc9\xae\x1c\x1d@e\x84!w5tS@'
165 | p69
166 | tp70
167 | bsg46
168 | NsbsS'global_transform'
169 | p71
170 | g0
171 | (cmenpofit.transform.homogeneous
172 | DifferentiableAlignmentSimilarity
173 | p72
174 | g2
175 | Ntp73
176 | Rp74
177 | (dp75
178 | S'_h_matrix'
179 | p76
180 | g12
181 | (g13
182 | (I0
183 | tp77
184 | g15
185 | tp78
186 | Rp79
187 | (I1
188 | (I3
189 | I3
190 | tp80
191 | g22
192 | I00
193 | S'\x02\x00\x00\x00\x00\x00\xf0?\xfe\xd0\xb7\xde\xcc]\xa4\xbc\x00\x00\x00\x00\x00\x00\xf29\xb8\xe8\xdc\x8e\x87\xa6\xa6\xbc\x01\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00\xba\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?'
194 | p81
195 | tp82
196 | bsg61
197 | g0
198 | (g35
199 | g2
200 | Ntp83
201 | Rp84
202 | (dp85
203 | g39
204 | g12
205 | (g13
206 | (I0
207 | tp86
208 | g15
209 | tp87
210 | Rp88
211 | (I1
212 | (I5
213 | I2
214 | tp89
215 | g22
216 | I00
217 | S"7\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0~\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0';\xfc\xfeGQ,\xc0\x9e \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0jA\x8c\x14\xfb\xe4C@\x19\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@"
218 | p90
219 | tp91
220 | bsg46
221 | NsbsS'allow_mirror'
222 | p92
223 | I00
224 | sS'_source'
225 | p93
226 | g84
227 | sbsS'model'
228 | p94
229 | g0
230 | (cmenpo.model.pca
231 | PCAModel
232 | p95
233 | g2
234 | Ntp96
235 | Rp97
236 | (dp98
237 | S'centred'
238 | p99
239 | I01
240 | sg34
241 | g0
242 | (g35
243 | g2
244 | Ntp100
245 | Rp101
246 | (dp102
247 | g39
248 | g12
249 | (g13
250 | (I0
251 | tp103
252 | g15
253 | tp104
254 | Rp105
255 | (I1
256 | (I5
257 | I2
258 | tp106
259 | g22
260 | I00
261 | S'\xb0^$\x13\xe9\xa1/@\xbbTX\x04`\x9aS\xc0\x94B\x93\xa1\x9f|\xf3\xbf\xfd@\xbc\xc7&\xd0C\xc0\x84\xb5\x1c\x04p\xb0 \xc0\x85\x83\x88\xa7\xd4\xad\xf7?\xd8\x85\xe4\xf4\xc93!\xc0\\H\xd41[PC@\xec\x13=h\x93\xc7\x02@\x1c/\xae|\x8e{S@'
262 | p107
263 | tp108
264 | bsg46
265 | NsbsS'_eigenvalues'
266 | p109
267 | g12
268 | (g13
269 | (I0
270 | tp110
271 | g15
272 | tp111
273 | Rp112
274 | (I1
275 | (I3
276 | tp113
277 | g22
278 | I00
279 | S"<}\x1f,D\xf3Y@\x17\xec\x02P\xa2G:@,\xcdw'\xb3\r$@"
280 | p114
281 | tp115
282 | bsS'_trimmed_eigenvalues'
283 | p116
284 | g12
285 | (g13
286 | (I0
287 | tp117
288 | g15
289 | tp118
290 | Rp119
291 | (I1
292 | (I4
293 | tp120
294 | g22
295 | I00
296 | S'I\xa0\xa6\x83\x8bD\x17@\x1f\xee\x14\x97\xbb\xd9\x11@7%sQ\xf1a\x05@\xc9\x95\xdd\xc5xr\xe6?'
297 | p121
298 | tp122
299 | bsg11
300 | g12
301 | (g13
302 | (I0
303 | tp123
304 | g15
305 | tp124
306 | Rp125
307 | (I1
308 | (I3
309 | I10
310 | tp126
311 | g22
312 | I00
313 | S'\x1f\xdaOz\xa4Q\xde?\'t\xdf\x8f\xa9\xa1\xd8?<\x18V\x94@\xa4\xd3\xbf\x81G\x04\xdb\xe6X\xca\xbf]\xd5\x13P\xf2e\xdf\xbf\x84\x14b\x97\xeeT\xbf\xbf[\xe8\xd6\xb6\x93c\xc1\xbf\x8d\xd9*\x97\xc1^\x90?\xa0\x87\x85EXj\xdd?p\xe3\xddW\x9a\x97\xb2\xbfwc\x0b\x83J[\xc0\xbf^\x83\xe2b\xdd\x8d\xdb?R\xec\xf9h\x8e\x92\xd3\xbf\x99\xb1s\xf3\xc4;\xd4\xbf\xc9w\xbf8\xc7\x01\xd1?\x9c\x97\xb1\xe3\xab\x06\xd5\xbf\t\x13RPa\x0f\xd7?5\xfe\x96~\x80O\xce\xbf\x86\xd9#\xbd\xe9\xa1\xc8\xbf\xf1D\x8e\xb3S\xdc\xdc?%\xd3\xb0\xdbT\xac\xd6\xbf\xe5\xb2\xab1`\x02\xc5?^"VL\x80G\xe1?\xbb\xe2\xf9\x1d{\xa1\xb7?\x05\x94-+@\xe7\xc0\xbf\x14\xff\x98\x8e\x8a\xc0\xdb\xbf\xa3\xd4\x02V6\xa5\xd7\xbfd\x0c+\x1a\x8f\xa4\xbf\xbf\x12-\x9e\xae*6\xd4?\tp\xcft\x1f@\xd3?'
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I10
326 | tp132
327 | g22
328 | I00
329 | S"7\x0e\xe8\xb4\xd4\x8e5@\xe6\x14\x81\\\xae\x02R\xc0~\xa4\xf6\xda\x85\xbe\x18\xc0\x03\x9e\x11/i\xa0E\xc0';\xfc\xfeGQ,\xc0\x9e \xb8\xab\x01z\x02\xc0\xfc\x94E\xe2u\xfb \xc0jA\x8c\x14\xfb\xe4C@\x19\x0c\xda\xc9\xae\x1c\x1d@d\x84!w5tS@"
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I3
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/basic_l_eye_2:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I12
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S'\x00\xfc\xf9\xeaWby\xbf\x9f\x18\xd1\x16gb\xe2?e\xbcdu\x9a>\xca?:\xad5\xed\xa4@\xcb?\x11q^\xd9S\x02\xc9?\xc92\x90\xa9\xdf\x05\xcc\xbf\\\xc9\xa5\xf3B\xc2\xb4\xbf\x9a\x03D\x14\x8c\xdf\xe2\xbf\x9c7\xf8\n\x97\xe4\xc3\xbf1\x13\x83\xb8L3\xca\xbf{A\xa0\n#0\xc4\xbf>E\xa9j\x1b\xed\xcc?\xa1\x18\xd1\x16gb\xe2\xbf\xd1\xfc\xf9\xeaWby\xbf9\xad5\xed\xa4@\xcb\xbff\xbcdu\x9a>\xca?\xca2\x90\xa9\xdf\x05\xcc?\x10q^\xd9S\x02\xc9?\x99\x03D\x14\x8c\xdf\xe2?c\xc9\xa5\xf3B\xc2\xb4\xbf0\x13\x83\xb8L3\xca?\x9e7\xf8\n\x97\xe4\xc3\xbf?E\xa9j\x1b\xed\xcc\xbfyA\xa0\n#0\xc4\xbf-,\x0cp\xbd \xda\xbf\x7fB\x0bl\xef\xd0\xb8\xbc9,\x0cp\xbd \xda\xbf\xf7\xa4y!\x85*\xc0\xbcG,\x0cp\xbd \xda\xbf\x95\x07\xb0\xe0\r\x88\xb1\xbcP,\x0cp\xbd \xda\xbfA\xbf\xd4\xe7\x8c`\xbb\xd0\xb7\x1b\xb9?\x97e\xc0\x84\xd4\x83\xda?\xecZZ\x04\xba\xe7\xdf\xbf\xc0\x0c\xbcA\xb8&\xb6\xbf\xef{\xb9\xe1Y"\xde\xbf\xf9Y\x04\xe1\x9b\x7f\xa1\xbf^O\xf9\xbe_\x99\xbb?N\x81\x06h\xcen\xc5\xbfK\xf4\xb9\x93\x7f*\xd7?\xb3%\xbb\xa3\xf8\xaf\xae\xbf\x9b\xd7\x8bnN\xb2\xd9?*\xc7\xd8\xbe2\xf3\xb0\xbf\x9aL\xe6UG:\xc8?\xd4\xe4*/9@\xda?]_\xdb\x16\x9f\xa2\xb6\xbf\xa3K\xb0%b\x9c\xd2\xbfr\xac\xf3\xf8\xf2&\xb5?\xf4\xc5V2D\xf9\xd6\xbf\xdc\x9aAnC\x00\xd5?\xc1\xc0\xc0\xfb\x00\r\xe1?\x9b\x96\xb4e\xab\xfe\xcf\xbf\x0e5\x0e\xe6\xee#\xc7\xbf!\x89\xe0^&\xbf\xd0\xbf\xda\xe8xnu\xca\xbc\xbf'
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I12
326 | tp132
327 | g22
328 | I00
329 | S"z\xd7\xc3\xce0H\xdb?\x17\x90\xc6\x9eF\xc2C\xc0\x83\xa3d\x13\xeb4,\xc0\x15Y\x05d@J-\xc0\x0b\x11\xf3\x03\xff\xe0*\xc0\x14\x08'\x0e:\x1e.@\x85\xbe\x0c\xc5\x94O\x16@\xa6yK\xd9\xc6HD@\xb5\xb5\xa6\x1dVa%@\x9d\xa7\xfe\xfc\xc4(,@\x14\x81\xb4\x10\x88\xb2%@t\xfd3\x91\xbf\x16/\xc0"
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I2
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/basic_r_brow_2:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I10
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S'\x80\xecY!\xaaO\xb0\xbf\x06\x8b\xc2W~H\xe4?D\xfe\xf3;$R\xb1?\xda\xc4\xf8\xc9C\xf0\xd3?\xceq\xee\xe8l\x13\xbd?\xaa\x81\x10\xbd\xc2B\x98\xbf\xc8\xeb&=\xdb[\xa8?L\xb5\xbc\xa1:^\xd6\xbf\xd6\xfc\rQ\xea!\xc5\xbf\xaa\x0e\xf8\xd5lO\xe2\xbf\x08\x8b\xc2W~H\xe4\xbfm\xecY!\xaaO\xb0\xbf\xd9\xc4\xf8\xc9C\xf0\xd3\xbfI\xfe\xf3;$R\xb1?\xb1\x81\x10\xbd\xc2B\x98?\xcaq\xee\xe8l\x13\xbd?J\xb5\xbc\xa1:^\xd6?\xb2\xeb&=\xdb[\xa8?\xa8\x0e\xf8\xd5lO\xe2?\xd9\xfc\rQ\xea!\xc5\xbf\xd0\xed\xbf\xc5%\x9f\xdc\xbfp\x08\x8f\xb1\xf2\xe9\x85\xbc\xd3\xed\xbf\xc5%\x9f\xdc\xbf\x08\x0b~\x1do\xf7\xa2\xbc\xd9\xed\xbf\xc5%\x9f\xdc\xbfJ\xd5\xd4\xc5\xa3\xfb\xa3\xbc\xe2\xed\xbf\xc5%\x9f\xdc\xbfP\xd6\xb7\xfeuC\x8e\xbc\xe7\xed\xbf\xc5%\x9f\xdc\xbf\xf6\x9eo\x13Z\xc1\xb3<\xc6R\xda\xc4\xd3\xf4\x9d<\xcc\xed\xbf\xc5%\x9f\xdc\xbfs^\xeei\xf5=\xaa<\xd3\xed\xbf\xc5%\x9f\xdc\xbf\xf2\x18&\x0b\xe2\xc5\xa0<\xd9\xed\xbf\xc5%\x9f\xdc\xbf\xd1\xd9\xf1\x16\x08\x15\x91\xbc\xde\xed\xbf\xc5%\x9f\xdc\xbf\xea\xf1\xcc\xf9X4\xb9\xbc\xe3\xed\xbf\xc5%\x9f\xdc\xbf'
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I10
72 | tp31
73 | g22
74 | I00
75 | S'\xb4\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xea\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd7\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x97pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@l\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
76 | p32
77 | tp33
78 | bsS'template_instance'
79 | p34
80 | g0
81 | (cmenpo.shape.pointcloud
82 | PointCloud
83 | p35
84 | g2
85 | Ntp36
86 | Rp37
87 | (dp38
88 | S'points'
89 | p39
90 | g12
91 | (g13
92 | (I0
93 | tp40
94 | g15
95 | tp41
96 | Rp42
97 | (I1
98 | (I5
99 | I2
100 | tp43
101 | g22
102 | I00
103 | S'\xb4\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xea\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd7\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x97pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@l\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
104 | p44
105 | tp45
106 | bsS'_landmarks'
107 | p46
108 | NsbsbsS'similarity_weights'
109 | p47
110 | g12
111 | (g13
112 | (I0
113 | tp48
114 | g15
115 | tp49
116 | Rp50
117 | (I1
118 | (I4
119 | tp51
120 | g22
121 | I00
122 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
123 | p52
124 | tp53
125 | bsS'_weights'
126 | p54
127 | g12
128 | (g13
129 | (I0
130 | tp55
131 | g15
132 | tp56
133 | Rp57
134 | (I1
135 | (I2
136 | tp58
137 | g22
138 | I00
139 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
140 | p59
141 | tp60
142 | bsS'_target'
143 | p61
144 | g0
145 | (g35
146 | g2
147 | Ntp62
148 | Rp63
149 | (dp64
150 | g39
151 | g12
152 | (g13
153 | (I0
154 | tp65
155 | g15
156 | tp66
157 | Rp67
158 | (I1
159 | (I5
160 | I2
161 | tp68
162 | g22
163 | I00
164 | S'\xba\x9c\x04\x0fq\xf1\x1f@\xc1k\x8e\xb9`\xdcS\xc0\xea\x9d\xb7\xde\xd0\xf5 \xc0l\xf6-u\xfc\x85C\xc0\xd9\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x9apt+\x04\xda\x17\xc0;\x8eI\t\x00\xe7E@l\xbf\xbe\xc5E\xb14@\xd5\xe1\x00d\xd3\xedQ@'
165 | p69
166 | tp70
167 | bsg46
168 | NsbsS'global_transform'
169 | p71
170 | g0
171 | (cmenpofit.transform.homogeneous
172 | DifferentiableAlignmentSimilarity
173 | p72
174 | g2
175 | Ntp73
176 | Rp74
177 | (dp75
178 | S'_h_matrix'
179 | p76
180 | g12
181 | (g13
182 | (I0
183 | tp77
184 | g15
185 | tp78
186 | Rp79
187 | (I1
188 | (I3
189 | I3
190 | tp80
191 | g22
192 | I00
193 | S'\x01\x00\x00\x00\x00\x00\xf0?\xc8C\xbfV\xa4\xf4\x8b\xbc\x00\x00\x00\x00\x00\x00\xe0\xb9\xf4Y\xdfg\x8f\x01\x84<\x01\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?'
194 | p81
195 | tp82
196 | bsg61
197 | g0
198 | (g35
199 | g2
200 | Ntp83
201 | Rp84
202 | (dp85
203 | g39
204 | g12
205 | (g13
206 | (I0
207 | tp86
208 | g15
209 | tp87
210 | Rp88
211 | (I1
212 | (I5
213 | I2
214 | tp89
215 | g22
216 | I00
217 | S'\xb4\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xea\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd7\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x97pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@l\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
218 | p90
219 | tp91
220 | bsg46
221 | NsbsS'allow_mirror'
222 | p92
223 | I00
224 | sS'_source'
225 | p93
226 | g84
227 | sbsS'model'
228 | p94
229 | g0
230 | (cmenpo.model.pca
231 | PCAModel
232 | p95
233 | g2
234 | Ntp96
235 | Rp97
236 | (dp98
237 | S'centred'
238 | p99
239 | I01
240 | sg34
241 | g0
242 | (g35
243 | g2
244 | Ntp100
245 | Rp101
246 | (dp102
247 | g39
248 | g12
249 | (g13
250 | (I0
251 | tp103
252 | g15
253 | tp104
254 | Rp105
255 | (I1
256 | (I5
257 | I2
258 | tp106
259 | g22
260 | I00
261 | S')\xab\x923\x12\x84\xef?\x93${u0YT\xc0Ej>\x05\xd5\xf9\x15\xc0w9\xf4\xd1EfC\xc0\xc2\x99\xd7\x8f\xa5\xa6\x19\xc0\x9f\xd6\xbf\xf3]\x8c\t@\xed\x8f\xfb\xc6z\x04\x03\xc0\xf3\xcf\xf6t4gD@|\xbb\x10\xd9\x1a\x99*@\x93\xda[4V\x0cS@'
262 | p107
263 | tp108
264 | bsg46
265 | NsbsS'_eigenvalues'
266 | p109
267 | g12
268 | (g13
269 | (I0
270 | tp110
271 | g15
272 | tp111
273 | Rp112
274 | (I1
275 | (I2
276 | tp113
277 | g22
278 | I00
279 | S'6\x9f\x9e\x9fo,Z@\xbbB\xdb\x13\xabd=@'
280 | p114
281 | tp115
282 | bsS'_trimmed_eigenvalues'
283 | p116
284 | g12
285 | (g13
286 | (I0
287 | tp117
288 | g15
289 | tp118
290 | Rp119
291 | (I1
292 | (I5
293 | tp120
294 | g22
295 | I00
296 | S'\x0cL\xe6\xdb\xe5\x1e%@\xbc\xa5C\x91\xfb\x04\x17@\xe4\xf9-\xc8\xeb\xb6\x0e@\x01\xc4\x060o\xd3\xff?p\x16\x9f\xaaw(\xe8?'
297 | p121
298 | tp122
299 | bsg11
300 | g12
301 | (g13
302 | (I0
303 | tp123
304 | g15
305 | tp124
306 | Rp125
307 | (I1
308 | (I2
309 | I10
310 | tp126
311 | g22
312 | I00
313 | S"\xe1\x02\xb3S\x85l\xdd?\xa1\xee\xd9\x91\xc1W\xb1?\x0b\x0bt\xce\xef\x9a\xc3\xbf~\xd2\x84\xc8\r\xedS\xbf\xc3\xf7IAj\xe1\xdf\xbf\xbe\xc5_\xdc:F\xbf?+\x9a\xfb\xcd'\xa9\xd2\xbf\xf0+*0\xf2E\xc8?\x93\x94\xcc\xa2\x84\xeb\xde?>\xfe\xda%\x8b6\xd8\xbf\xe0\xad\xec\xb8\x07G\xc3?\xf8\r\xf1u\xa3\xc8\xdd?s\x07\xe4\xf03\x17\xd4\xbf\xb4\x93g\x1by(\xcf\xbf|\xc7\xff\xaf\x92\x83\xd0\xbf:M\x8b\x92\x99\xd5\xd7\xbf\xe9k\xfe\xd1^\xe6\xd0?\xf9\x043'\x96\xa2\xd3\xbf%\x18\xde\xe4\xc7!\xc4?\x15\x0e\x81\xd1\xc8C\xdd?"
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I10
326 | tp132
327 | g22
328 | I00
329 | S'\xb4\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xea\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd7\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x97pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@l\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I2
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/basic_r_brow_3:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I10
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S"\x80\xecY!\xaaO\xb0\xbf\x07\x8b\xc2W~H\xe4?C\xfe\xf3;$R\xb1?\xda\xc4\xf8\xc9C\xf0\xd3?\xcdq\xee\xe8l\x13\xbd?\xb0\x81\x10\xbd\xc2B\x98\xbf\xc5\xeb&=\xdb[\xa8?M\xb5\xbc\xa1:^\xd6\xbf\xd4\xfc\rQ\xea!\xc5\xbf\xa9\x0e\xf8\xd5lO\xe2\xbf\x07\x8b\xc2W~H\xe4\xbfm\xecY!\xaaO\xb0\xbf\xd7\xc4\xf8\xc9C\xf0\xd3\xbfF\xfe\xf3;$R\xb1?\xb3\x81\x10\xbd\xc2B\x98?\xc9q\xee\xe8l\x13\xbd?K\xb5\xbc\xa1:^\xd6?\xb2\xeb&=\xdb[\xa8?\xa7\x0e\xf8\xd5lO\xe2?\xd6\xfc\rQ\xea!\xc5\xbf\xd0\xed\xbf\xc5%\x9f\xdc\xbf\xa0\x1a\xcf\xeb\xccJ\x89\xbc\xd3\xed\xbf\xc5%\x9f\xdc\xbf\x10\x16\xfc:\xde\xee\x9d\xbc\xd9\xed\xbf\xc5%\x9f\xdc\xbf\x94T\x8e?\xdb\x99\xa2\xbc\xe2\xed\xbf\xc5%\x9f\xdc\xbfp\x9a/\xc3\x11&y\xbc\xe6\xed\xbf\xc5%\x9f\xdc\xbf\xb0\x9c'\xcc>U\xb1<\r0\xe7O\x05\xbb\xa8<\xcb\xed\xbf\xc5%\x9f\xdc\xbfms\xcb\xb6\xe7\x1a\xa7<\xd3\xed\xbf\xc5%\x9f\xdc\xbf\x1cZMT\x85\xd6\xa2<\xd9\xed\xbf\xc5%\x9f\xdc\xbf.\xb0\xc5,\xc6\xed\x91\xbc\xde\xed\xbf\xc5%\x9f\xdc\xbf\xb7\xd7|\xf7P\xf5\xb7\xbc\xe3\xed\xbf\xc5%\x9f\xdc\xbf"
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I10
72 | tp31
73 | g22
74 | I00
75 | S'\xbb\x9c\x04\x0fq\xf1\x1f@\xc1k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x13\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0;\x8eI\t\x00\xe7E@k\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
76 | p32
77 | tp33
78 | bsS'template_instance'
79 | p34
80 | g0
81 | (cmenpo.shape.pointcloud
82 | PointCloud
83 | p35
84 | g2
85 | Ntp36
86 | Rp37
87 | (dp38
88 | S'points'
89 | p39
90 | g12
91 | (g13
92 | (I0
93 | tp40
94 | g15
95 | tp41
96 | Rp42
97 | (I1
98 | (I5
99 | I2
100 | tp43
101 | g22
102 | I00
103 | S'\xbb\x9c\x04\x0fq\xf1\x1f@\xc1k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x13\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0;\x8eI\t\x00\xe7E@k\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
104 | p44
105 | tp45
106 | bsS'_landmarks'
107 | p46
108 | NsbsbsS'similarity_weights'
109 | p47
110 | g12
111 | (g13
112 | (I0
113 | tp48
114 | g15
115 | tp49
116 | Rp50
117 | (I1
118 | (I4
119 | tp51
120 | g22
121 | I00
122 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
123 | p52
124 | tp53
125 | bsS'_weights'
126 | p54
127 | g12
128 | (g13
129 | (I0
130 | tp55
131 | g15
132 | tp56
133 | Rp57
134 | (I1
135 | (I3
136 | tp58
137 | g22
138 | I00
139 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
140 | p59
141 | tp60
142 | bsS'_target'
143 | p61
144 | g0
145 | (g35
146 | g2
147 | Ntp62
148 | Rp63
149 | (dp64
150 | g39
151 | g12
152 | (g13
153 | (I0
154 | tp65
155 | g15
156 | tp66
157 | Rp67
158 | (I1
159 | (I5
160 | I2
161 | tp68
162 | g22
163 | I00
164 | S'\xc8\x9c\x04\x0fq\xf1\x1f@\xc2k\x8e\xb9`\xdcS\xc0\xe4\x9d\xb7\xde\xd0\xf5 \xc0l\xf6-u\xfc\x85C\xc0\xd5\xf6\x8d\x1eqx,\xc0\x16\xbe\xf7oq\xc1\x07@\x9bpt+\x04\xda\x17\xc0<\x8eI\t\x00\xe7E@g\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
165 | p69
166 | tp70
167 | bsg46
168 | NsbsS'global_transform'
169 | p71
170 | g0
171 | (cmenpofit.transform.homogeneous
172 | DifferentiableAlignmentSimilarity
173 | p72
174 | g2
175 | Ntp73
176 | Rp74
177 | (dp75
178 | S'_h_matrix'
179 | p76
180 | g12
181 | (g13
182 | (I0
183 | tp77
184 | g15
185 | tp78
186 | Rp79
187 | (I1
188 | (I3
189 | I3
190 | tp80
191 | g22
192 | I00
193 | S'\xff\xff\xff\xff\xff\xff\xef?\xd0\x1e;_v\t\xa7\xbc\x00\x00\x00\x00\x00\x00\xe0\xb9\xa8\xf4\xd42G\x06\x84\xbc\x01\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?'
194 | p81
195 | tp82
196 | bsg61
197 | g0
198 | (g35
199 | g2
200 | Ntp83
201 | Rp84
202 | (dp85
203 | g39
204 | g12
205 | (g13
206 | (I0
207 | tp86
208 | g15
209 | tp87
210 | Rp88
211 | (I1
212 | (I5
213 | I2
214 | tp89
215 | g22
216 | I00
217 | S'\xbb\x9c\x04\x0fq\xf1\x1f@\xc1k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x13\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0;\x8eI\t\x00\xe7E@k\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
218 | p90
219 | tp91
220 | bsg46
221 | NsbsS'allow_mirror'
222 | p92
223 | I00
224 | sS'_source'
225 | p93
226 | g84
227 | sbsS'model'
228 | p94
229 | g0
230 | (cmenpo.model.pca
231 | PCAModel
232 | p95
233 | g2
234 | Ntp96
235 | Rp97
236 | (dp98
237 | S'centred'
238 | p99
239 | I01
240 | sg34
241 | g0
242 | (g35
243 | g2
244 | Ntp100
245 | Rp101
246 | (dp102
247 | g39
248 | g12
249 | (g13
250 | (I0
251 | tp103
252 | g15
253 | tp104
254 | Rp105
255 | (I1
256 | (I5
257 | I2
258 | tp106
259 | g22
260 | I00
261 | S'B\xab\x923\x12\x84\xef?\x93${u0YT\xc0Dj>\x05\xd5\xf9\x15\xc0w9\xf4\xd1EfC\xc0\xc2\x99\xd7\x8f\xa5\xa6\x19\xc0\xa6\xd6\xbf\xf3]\x8c\t@\xf0\x8f\xfb\xc6z\x04\x03\xc0\xf3\xcf\xf6t4gD@{\xbb\x10\xd9\x1a\x99*@\x93\xda[4V\x0cS@'
262 | p107
263 | tp108
264 | bsg46
265 | NsbsS'_eigenvalues'
266 | p109
267 | g12
268 | (g13
269 | (I0
270 | tp110
271 | g15
272 | tp111
273 | Rp112
274 | (I1
275 | (I3
276 | tp113
277 | g22
278 | I00
279 | S'6\x9f\x9e\x9fo,Z@\xbaB\xdb\x13\xabd=@\rL\xe6\xdb\xe5\x1e%@'
280 | p114
281 | tp115
282 | bsS'_trimmed_eigenvalues'
283 | p116
284 | g12
285 | (g13
286 | (I0
287 | tp117
288 | g15
289 | tp118
290 | Rp119
291 | (I1
292 | (I4
293 | tp120
294 | g22
295 | I00
296 | S'\xbd\xa5C\x91\xfb\x04\x17@\xd7\xf9-\xc8\xeb\xb6\x0e@\x04\xc4\x060o\xd3\xff?z\x16\x9f\xaaw(\xe8?'
297 | p121
298 | tp122
299 | bsg11
300 | g12
301 | (g13
302 | (I0
303 | tp123
304 | g15
305 | tp124
306 | Rp125
307 | (I1
308 | (I3
309 | I10
310 | tp126
311 | g22
312 | I00
313 | S"\xe1\x02\xb3S\x85l\xdd?\x9d\xee\xd9\x91\xc1W\xb1?\x13\x0bt\xce\xef\x9a\xc3\xbf\xfe\xd0\x84\xc8\r\xedS\xbf\xc0\xf7IAj\xe1\xdf\xbf\xc2\xc5_\xdc:F\xbf?-\x9a\xfb\xcd'\xa9\xd2\xbf\xf0+*0\xf2E\xc8?\x94\x94\xcc\xa2\x84\xeb\xde?A\xfe\xda%\x8b6\xd8\xbf\xde\xad\xec\xb8\x07G\xc3?\xf6\r\xf1u\xa3\xc8\xdd?q\x07\xe4\xf03\x17\xd4\xbf\xb1\x93g\x1by(\xcf\xbf|\xc7\xff\xaf\x92\x83\xd0\xbf:M\x8b\x92\x99\xd5\xd7\xbf\xe7k\xfe\xd1^\xe6\xd0?\xf6\x043'\x96\xa2\xd3\xbf*\x18\xde\xe4\xc7!\xc4?\x14\x0e\x81\xd1\xc8C\xdd?>#\xad\xf3\xfc(\xd4\xbfI\xdeq\xe1\\[\xcb?3\xb0\xb4E\xf0\xd0\xd9?\xb9\xf1\x13\xcd~\xb9\xa2\xbf\xd0\x1c\x11 oZ\xc1?\xc4\xabv\x87w\x0e\xd8\xbf \x19\x06E\xa6@\xe3\xbf\xa7\xb9\xee\xc0\x06\x93\xa4?\xeb\x16\xfc\xa7!,\xd8?D\xc7\x8400K\xc4?"
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I10
326 | tp132
327 | g22
328 | I00
329 | S'\xbb\x9c\x04\x0fq\xf1\x1f@\xc1k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x13\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0;\x8eI\t\x00\xe7E@k\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I3
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/basic_r_eye_2:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I12
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S"\xd0\xf6'\x90%\xbb\xb8\xbfA/\\\xc3[c\xe3?8\xd1\xce\xa7su\xc9?\xce\xe8\x1b\x91\x0b-\xcc?\xf9\x01\x86R\xaa\x12\xca?\xf1&N\xdd\x10\x7f\xca\xbf\xaa\x8a\xc309uq?\x8e-fd\xd4\xe0\xe1\xbfQ\x18\xf3\x91.\xc9\xc2\xbf\xb4\x81\xa1I\xa1\xdb\xce\xbf\xa8\xdb\xd3i\x06\xed\xc4\xbf\xd1\xb8\xfb\x19\x89#\xc7?B/\\\xc3[c\xe3\xbf\xd6\xf6'\x90%\xbb\xb8\xbf\xce\xe8\x1b\x91\x0b-\xcc\xbf9\xd1\xce\xa7su\xc9?\xf2&N\xdd\x10\x7f\xca?\xf9\x01\x86R\xaa\x12\xca?\x8f-fd\xd4\xe0\xe1?\x99\x8a\xc309uq?\xb6\x81\xa1I\xa1\xdb\xce?R\x18\xf3\x91.\xc9\xc2\xbf\xd2\xb8\xfb\x19\x89#\xc7\xbf\xa9\xdb\xd3i\x06\xed\xc4\xbfG,\x0cp\xbd \xda\xbf\xf4\xbd#\xbc\xcb\xe0\x94<<,\x0cp\xbd \xda\xbfr\xc2tu\xe2\xe2\xb1<:,\x0cp\xbd \xda\xbf*\xf5\xba\x0b\x06<\x92<7,\x0cp\xbd \xda\xbf'> |\x90w\xb1\xbc;,\x0cp\xbd \xda\xbf\x05\xa6\x89\x90f,\xae\xbcA,\x0cp\xbd \xda\xbf\xa8(q\xeeb\x12\x90\xbc\x9e\x12\xec\xff\xabs\xb3\xbcG,\x0cp\xbd \xda\xbfs\xb39\xe7\x93\xe3\xb0\xbcB,\x0cp\xbd \xda\xbfyO\x02:\xe0\x8bU\xbc;,\x0cp\xbd \xda\xbfe\x07go\x0f\x9e\xb4<8,\x0cp\xbd \xda\xbf\x0f\x8a\xa2\x15O\xb9\xb0,\x0cp\xbd \xda\xbf0\x97f\xb8+;\x83\xca?:\xad5\xed\xa4@\xcb?\x10q^\xd9S\x02\xc9?\xc82\x90\xa9\xdf\x05\xcc\xbf]\xc9\xa5\xf3B\xc2\xb4\xbf\x9a\x03D\x14\x8c\xdf\xe2\xbf\x9d7\xf8\n\x97\xe4\xc3\xbf2\x13\x83\xb8L3\xca\xbf}A\xa0\n#0\xc4\xbf?E\xa9j\x1b\xed\xcc?\xa1\x18\xd1\x16gb\xe2\xbf\x1b\xfd\xf9\xeaWby\xbf7\xad5\xed\xa4@\xcb\xbfd\xbcdu\x9a>\xca?\xc82\x90\xa9\xdf\x05\xcc?\rq^\xd9S\x02\xc9?\x99\x03D\x14\x8c\xdf\xe2?f\xc9\xa5\xf3B\xc2\xb4\xbf0\x13\x83\xb8L3\xca?\x9e7\xf8\n\x97\xe4\xc3\xbf?E\xa9j\x1b\xed\xcc\xbfzA\xa0\n#0\xc4\xbf+,\x0cp\xbd \xda\xbfeU\xd4\xaea\xa6\xb6\xbc:,\x0cp\xbd \xda\xbf\xde\x8a\xe9{\xb5k\xc2\xbcH,\x0cp\xbd \xda\xbf^\xf8h1\xc2\xae\xac\xbcO,\x0cp\xbd \xda\xbf~\x1a\xbf\x8a\x8b\xaa\xc4<@,\x0cp\xbd \xda\xbf.rV\xf3ts\xbe<3,\x0cp\xbd \xda\xbfS\x93}\x0b\x04\x84\xa2<\x1b.;\x0e\xf5\x94\xbf<,,\x0cp\xbd \xda\xbf\xda7\x12\xb7?\xf8\xbe<7,\x0cp\xbd \xda\xbf\xbc\xcb\xdf\x81C\xe7\x9f\xd0\xb7\x1b\xb9?\x97e\xc0\x84\xd4\x83\xda?\xeaZZ\x04\xba\xe7\xdf\xbf\xc7\x0c\xbcA\xb8&\xb6\xbf\xec{\xb9\xe1Y"\xde\xbf\xffY\x04\xe1\x9b\x7f\xa1\xbfSO\xf9\xbe_\x99\xbb?I\x81\x06h\xcen\xc5\xbfM\xf4\xb9\x93\x7f*\xd7?\xa8%\xbb\xa3\xf8\xaf\xae\xbf\x9f\xd7\x8bnN\xb2\xd9?*\xc7\xd8\xbe2\xf3\xb0\xbf\xa2L\xe6UG:\xc8?\xd6\xe4*/9@\xda?c_\xdb\x16\x9f\xa2\xb6\xbf\x9fK\xb0%b\x9c\xd2\xbfw\xac\xf3\xf8\xf2&\xb5?\xed\xc5V2D\xf9\xd6\xbf\xdc\x9aAnC\x00\xd5?\xc1\xc0\xc0\xfb\x00\r\xe1?\x9f\x96\xb4e\xab\xfe\xcf\xbf\x1a5\x0e\xe6\xee#\xc7\xbf!\x89\xe0^&\xbf\xd0\xbf\xf4\xe8xnu\xca\xbc\xbf'
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I12
326 | tp132
327 | g22
328 | I00
329 | S"\xb1\xd7\xc3\xce0H\xdb?\x17\x90\xc6\x9eF\xc2C\xc0\x80\xa3d\x13\xeb4,\xc0\x15Y\x05d@J-\xc0\t\x11\xf3\x03\xff\xe0*\xc0\x12\x08'\x0e:\x1e.@\x85\xbe\x0c\xc5\x94O\x16@\xa6yK\xd9\xc6HD@\xb6\xb5\xa6\x1dVa%@\x9d\xa7\xfe\xfc\xc4(,@\x15\x81\xb4\x10\x88\xb2%@t\xfd3\x91\xbf\x16/\xc0"
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I2
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/g_t_r_brow_2:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I10
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S'\x80\xecY!\xaaO\xb0\xbf\x06\x8b\xc2W~H\xe4?B\xfe\xf3;$R\xb1?\xda\xc4\xf8\xc9C\xf0\xd3?\xcdq\xee\xe8l\x13\xbd?\xab\x81\x10\xbd\xc2B\x98\xbf\xc5\xeb&=\xdb[\xa8?L\xb5\xbc\xa1:^\xd6\xbf\xd7\xfc\rQ\xea!\xc5\xbf\xaa\x0e\xf8\xd5lO\xe2\xbf\x06\x8b\xc2W~H\xe4\xbff\xecY!\xaaO\xb0\xbf\xd8\xc4\xf8\xc9C\xf0\xd3\xbfB\xfe\xf3;$R\xb1?\xaa\x81\x10\xbd\xc2B\x98?\xcaq\xee\xe8l\x13\xbd?J\xb5\xbc\xa1:^\xd6?\xbc\xeb&=\xdb[\xa8?\xa8\x0e\xf8\xd5lO\xe2?\xd6\xfc\rQ\xea!\xc5\xbf\xcf\xed\xbf\xc5%\x9f\xdc\xbf\xde\rJ>\xb5}\x94\xbc\xd3\xed\xbf\xc5%\x9f\xdc\xbf\xdeEc\xe2?O\xa5\xbc\xd9\xed\xbf\xc5%\x9f\xdc\xbf\xfe"\x8d\x95DG\xa4\xbc\xe2\xed\xbf\xc5%\x9f\xdc\xbf8\xd1\x11/\xc1\xfe]\xbc\xe6\xed\xbf\xc5%\x9f\xdc\xbf/\x92>\xf6.\xe8\xb5<\xcb^\xa7\x7f\x18\x84\x9c<\xcc\xed\xbf\xc5%\x9f\xdc\xbf(\xf4\x15\x82\xafI\xaa<\xd3\xed\xbf\xc5%\x9f\xdc\xbf \x91\xad\x8b\x91Y\xa2<\xd8\xed\xbf\xc5%\x9f\xdc\xbf\xa9/H|\x0b\xcc]\xbc\xde\xed\xbf\xc5%\x9f\xdc\xbf\xe5b\x11Y\xb5x\xb5\xbc\xe3\xed\xbf\xc5%\x9f\xdc\xbf'
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I10
72 | tp31
73 | g22
74 | I00
75 | S'\xb7\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xe8\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0f\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@m\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
76 | p32
77 | tp33
78 | bsS'template_instance'
79 | p34
80 | g0
81 | (cmenpo.shape.pointcloud
82 | PointCloud
83 | p35
84 | g2
85 | Ntp36
86 | Rp37
87 | (dp38
88 | S'points'
89 | p39
90 | g12
91 | (g13
92 | (I0
93 | tp40
94 | g15
95 | tp41
96 | Rp42
97 | (I1
98 | (I5
99 | I2
100 | tp43
101 | g22
102 | I00
103 | S'\xb7\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xe8\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0f\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@m\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
104 | p44
105 | tp45
106 | bsS'_landmarks'
107 | p46
108 | NsbsbsS'similarity_weights'
109 | p47
110 | g12
111 | (g13
112 | (I0
113 | tp48
114 | g15
115 | tp49
116 | Rp50
117 | (I1
118 | (I4
119 | tp51
120 | g22
121 | I00
122 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
123 | p52
124 | tp53
125 | bsS'_weights'
126 | p54
127 | g12
128 | (g13
129 | (I0
130 | tp55
131 | g15
132 | tp56
133 | Rp57
134 | (I1
135 | (I2
136 | tp58
137 | g22
138 | I00
139 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
140 | p59
141 | tp60
142 | bsS'_target'
143 | p61
144 | g0
145 | (g35
146 | g2
147 | Ntp62
148 | Rp63
149 | (dp64
150 | g39
151 | g12
152 | (g13
153 | (I0
154 | tp65
155 | g15
156 | tp66
157 | Rp67
158 | (I1
159 | (I5
160 | I2
161 | tp68
162 | g22
163 | I00
164 | S'\xac\x9c\x04\x0fq\xf1\x1f@\xbfk\x8e\xb9`\xdcS\xc0\xe8\x9d\xb7\xde\xd0\xf5 \xc0j\xf6-u\xfc\x85C\xc0\xd2\xf6\x8d\x1eqx,\xc0\x0f\xbe\xf7oq\xc1\x07@\x8dpt+\x04\xda\x17\xc09\x8eI\t\x00\xe7E@l\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
165 | p69
166 | tp70
167 | bsg46
168 | NsbsS'global_transform'
169 | p71
170 | g0
171 | (cmenpofit.transform.homogeneous
172 | DifferentiableAlignmentSimilarity
173 | p72
174 | g2
175 | Ntp73
176 | Rp74
177 | (dp75
178 | S'_h_matrix'
179 | p76
180 | g12
181 | (g13
182 | (I0
183 | tp77
184 | g15
185 | tp78
186 | Rp79
187 | (I1
188 | (I3
189 | I3
190 | tp80
191 | g22
192 | I00
193 | S'\xfc\xff\xff\xff\xff\xff\xef?\xa4$\xeb\x82\xdf\xf6\x97<\x00\x00\x00\x00\x00\x00\xf09V\x04\xc2{\x8b\t\x8c\xbc\xfe\xff\xff\xff\xff\xff\xef?\x00\x00\x00\x00\x00\x00\xf0\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?'
194 | p81
195 | tp82
196 | bsg61
197 | g0
198 | (g35
199 | g2
200 | Ntp83
201 | Rp84
202 | (dp85
203 | g39
204 | g12
205 | (g13
206 | (I0
207 | tp86
208 | g15
209 | tp87
210 | Rp88
211 | (I1
212 | (I5
213 | I2
214 | tp89
215 | g22
216 | I00
217 | S'\xb7\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xe8\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0f\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@m\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
218 | p90
219 | tp91
220 | bsg46
221 | NsbsS'allow_mirror'
222 | p92
223 | I00
224 | sS'_source'
225 | p93
226 | g84
227 | sbsS'model'
228 | p94
229 | g0
230 | (cmenpo.model.pca
231 | PCAModel
232 | p95
233 | g2
234 | Ntp96
235 | Rp97
236 | (dp98
237 | S'centred'
238 | p99
239 | I01
240 | sg34
241 | g0
242 | (g35
243 | g2
244 | Ntp100
245 | Rp101
246 | (dp102
247 | g39
248 | g12
249 | (g13
250 | (I0
251 | tp103
252 | g15
253 | tp104
254 | Rp105
255 | (I1
256 | (I5
257 | I2
258 | tp106
259 | g22
260 | I00
261 | S'0\xab\x923\x12\x84\xef?\x93${u0YT\xc0Dj>\x05\xd5\xf9\x15\xc0w9\xf4\xd1EfC\xc0\xc1\x99\xd7\x8f\xa5\xa6\x19\xc0\x9f\xd6\xbf\xf3]\x8c\t@\xec\x8f\xfb\xc6z\x04\x03\xc0\xf3\xcf\xf6t4gD@}\xbb\x10\xd9\x1a\x99*@\x93\xda[4V\x0cS@'
262 | p107
263 | tp108
264 | bsg46
265 | NsbsS'_eigenvalues'
266 | p109
267 | g12
268 | (g13
269 | (I0
270 | tp110
271 | g15
272 | tp111
273 | Rp112
274 | (I1
275 | (I2
276 | tp113
277 | g22
278 | I00
279 | S'2\x9f\x9e\x9fo,Z@\xb9B\xdb\x13\xabd=@'
280 | p114
281 | tp115
282 | bsS'_trimmed_eigenvalues'
283 | p116
284 | g12
285 | (g13
286 | (I0
287 | tp117
288 | g15
289 | tp118
290 | Rp119
291 | (I1
292 | (I5
293 | tp120
294 | g22
295 | I00
296 | S'\rL\xe6\xdb\xe5\x1e%@\xbc\xa5C\x91\xfb\x04\x17@\xd7\xf9-\xc8\xeb\xb6\x0e@\xf6\xc3\x060o\xd3\xff?7\x16\x9f\xaaw(\xe8?'
297 | p121
298 | tp122
299 | bsg11
300 | g12
301 | (g13
302 | (I0
303 | tp123
304 | g15
305 | tp124
306 | Rp125
307 | (I1
308 | (I2
309 | I10
310 | tp126
311 | g22
312 | I00
313 | S"\xdc\x02\xb3S\x85l\xdd?\xa0\xee\xd9\x91\xc1W\xb1?\x0e\x0bt\xce\xef\x9a\xc3\xbf\x07\xd0\x84\xc8\r\xedS\xbf\xbf\xf7IAj\xe1\xdf\xbf\xc4\xc5_\xdc:F\xbf?-\x9a\xfb\xcd'\xa9\xd2\xbf\xf1+*0\xf2E\xc8?\x91\x94\xcc\xa2\x84\xeb\xde?A\xfe\xda%\x8b6\xd8\xbf\xe8\xad\xec\xb8\x07G\xc3?\xf1\r\xf1u\xa3\xc8\xdd?y\x07\xe4\xf03\x17\xd4\xbf\xa5\x93g\x1by(\xcf\xbf|\xc7\xff\xaf\x92\x83\xd0\xbf7M\x8b\x92\x99\xd5\xd7\xbf\xeek\xfe\xd1^\xe6\xd0?\xf9\x043'\x96\xa2\xd3\xbf!\x18\xde\xe4\xc7!\xc4?\x10\x0e\x81\xd1\xc8C\xdd?"
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I10
326 | tp132
327 | g22
328 | I00
329 | S'\xb7\x9c\x04\x0fq\xf1\x1f@\xc0k\x8e\xb9`\xdcS\xc0\xe8\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0f\xbe\xf7oq\xc1\x07@\x94pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@m\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I2
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/g_t_r_brow_3:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I10
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S'p\xecY!\xaaO\xb0\xbf\x07\x8b\xc2W~H\xe4?B\xfe\xf3;$R\xb1?\xd9\xc4\xf8\xc9C\xf0\xd3?\xcbq\xee\xe8l\x13\xbd?\xa9\x81\x10\xbd\xc2B\x98\xbf\xc0\xeb&=\xdb[\xa8?K\xb5\xbc\xa1:^\xd6\xbf\xd6\xfc\rQ\xea!\xc5\xbf\xa8\x0e\xf8\xd5lO\xe2\xbf\x08\x8b\xc2W~H\xe4\xbfc\xecY!\xaaO\xb0\xbf\xd9\xc4\xf8\xc9C\xf0\xd3\xbfF\xfe\xf3;$R\xb1?\xad\x81\x10\xbd\xc2B\x98?\xcaq\xee\xe8l\x13\xbd?K\xb5\xbc\xa1:^\xd6?\xb2\xeb&=\xdb[\xa8?\xa8\x0e\xf8\xd5lO\xe2?\xd9\xfc\rQ\xea!\xc5\xbf\xce\xed\xbf\xc5%\x9f\xdc\xbf\xb7\xa9\x0c^Kg\x91\xbc\xd3\xed\xbf\xc5%\x9f\xdc\xbf\xb3\x80H\xa7\x10\xa7\xa3\xbc\xda\xed\xbf\xc5%\x9f\xdc\xbf\xfbp.\xceh\xa0\xa3\xbc\xe2\xed\xbf\xc5%\x9f\xdc\xbf\xfc;\x19\x9atxr\xbc\xe6\xed\xbf\xc5%\x9f\xdc\xbf"\x83\xc5\x91\xe8\xa2\xb5<\x14&\x03\x88\xa3@\x97<\xca\xed\xbf\xc5%\x9f\xdc\xbf\x1a\xc4\xab\xced\\\xa4<\xd2\xed\xbf\xc5%\x9f\xdc\xbf\xfb\xb8@\xd8A\xe5\xa2<\xd9\xed\xbf\xc5%\x9f\xdc\xbfhp\xd3_\xb0\xc1\x90\xbc\xdf\xed\xbf\xc5%\x9f\xdc\xbfE7\xdbU\xb5/\xb7\xbc\xe6\xed\xbf\xc5%\x9f\xdc\xbf'
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I10
72 | tp31
73 | g22
74 | I00
75 | S'\xb6\x9c\x04\x0fq\xf1\x1f@\xc2k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x90pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@n\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
76 | p32
77 | tp33
78 | bsS'template_instance'
79 | p34
80 | g0
81 | (cmenpo.shape.pointcloud
82 | PointCloud
83 | p35
84 | g2
85 | Ntp36
86 | Rp37
87 | (dp38
88 | S'points'
89 | p39
90 | g12
91 | (g13
92 | (I0
93 | tp40
94 | g15
95 | tp41
96 | Rp42
97 | (I1
98 | (I5
99 | I2
100 | tp43
101 | g22
102 | I00
103 | S'\xb6\x9c\x04\x0fq\xf1\x1f@\xc2k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x90pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@n\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
104 | p44
105 | tp45
106 | bsS'_landmarks'
107 | p46
108 | NsbsbsS'similarity_weights'
109 | p47
110 | g12
111 | (g13
112 | (I0
113 | tp48
114 | g15
115 | tp49
116 | Rp50
117 | (I1
118 | (I4
119 | tp51
120 | g22
121 | I00
122 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
123 | p52
124 | tp53
125 | bsS'_weights'
126 | p54
127 | g12
128 | (g13
129 | (I0
130 | tp55
131 | g15
132 | tp56
133 | Rp57
134 | (I1
135 | (I3
136 | tp58
137 | g22
138 | I00
139 | S'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
140 | p59
141 | tp60
142 | bsS'_target'
143 | p61
144 | g0
145 | (g35
146 | g2
147 | Ntp62
148 | Rp63
149 | (dp64
150 | g39
151 | g12
152 | (g13
153 | (I0
154 | tp65
155 | g15
156 | tp66
157 | Rp67
158 | (I1
159 | (I5
160 | I2
161 | tp68
162 | g22
163 | I00
164 | S'\xca\x9c\x04\x0fq\xf1\x1f@\xc3k\x8e\xb9`\xdcS\xc0\xe3\x9d\xb7\xde\xd0\xf5 \xc0l\xf6-u\xfc\x85C\xc0\xd5\xf6\x8d\x1eqx,\xc0\x0b\xbe\xf7oq\xc1\x07@\x9bpt+\x04\xda\x17\xc0;\x8eI\t\x00\xe7E@h\xbf\xbe\xc5E\xb14@\xd4\xe1\x00d\xd3\xedQ@'
165 | p69
166 | tp70
167 | bsg46
168 | NsbsS'global_transform'
169 | p71
170 | g0
171 | (cmenpofit.transform.homogeneous
172 | DifferentiableAlignmentSimilarity
173 | p72
174 | g2
175 | Ntp73
176 | Rp74
177 | (dp75
178 | S'_h_matrix'
179 | p76
180 | g12
181 | (g13
182 | (I0
183 | tp77
184 | g15
185 | tp78
186 | Rp79
187 | (I1
188 | (I3
189 | I3
190 | tp80
191 | g22
192 | I00
193 | S'\xff\xff\xff\xff\xff\xff\xef?b\x94oj\t\x02\xb1\xbc\x00\x00\x00\x00\x00\x00\xf0\xb9#\xb9A\x02\x15\xf7\xa4<\x01\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\xf09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?'
194 | p81
195 | tp82
196 | bsg61
197 | g0
198 | (g35
199 | g2
200 | Ntp83
201 | Rp84
202 | (dp85
203 | g39
204 | g12
205 | (g13
206 | (I0
207 | tp86
208 | g15
209 | tp87
210 | Rp88
211 | (I1
212 | (I5
213 | I2
214 | tp89
215 | g22
216 | I00
217 | S'\xb6\x9c\x04\x0fq\xf1\x1f@\xc2k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x90pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@n\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
218 | p90
219 | tp91
220 | bsg46
221 | NsbsS'allow_mirror'
222 | p92
223 | I00
224 | sS'_source'
225 | p93
226 | g84
227 | sbsS'model'
228 | p94
229 | g0
230 | (cmenpo.model.pca
231 | PCAModel
232 | p95
233 | g2
234 | Ntp96
235 | Rp97
236 | (dp98
237 | S'centred'
238 | p99
239 | I01
240 | sg34
241 | g0
242 | (g35
243 | g2
244 | Ntp100
245 | Rp101
246 | (dp102
247 | g39
248 | g12
249 | (g13
250 | (I0
251 | tp103
252 | g15
253 | tp104
254 | Rp105
255 | (I1
256 | (I5
257 | I2
258 | tp106
259 | g22
260 | I00
261 | S'9\xab\x923\x12\x84\xef?\x92${u0YT\xc0Dj>\x05\xd5\xf9\x15\xc0v9\xf4\xd1EfC\xc0\xbf\x99\xd7\x8f\xa5\xa6\x19\xc0\x9e\xd6\xbf\xf3]\x8c\t@\xe8\x8f\xfb\xc6z\x04\x03\xc0\xf2\xcf\xf6t4gD@\x7f\xbb\x10\xd9\x1a\x99*@\x92\xda[4V\x0cS@'
262 | p107
263 | tp108
264 | bsg46
265 | NsbsS'_eigenvalues'
266 | p109
267 | g12
268 | (g13
269 | (I0
270 | tp110
271 | g15
272 | tp111
273 | Rp112
274 | (I1
275 | (I3
276 | tp113
277 | g22
278 | I00
279 | S'5\x9f\x9e\x9fo,Z@\xbdB\xdb\x13\xabd=@\x10L\xe6\xdb\xe5\x1e%@'
280 | p114
281 | tp115
282 | bsS'_trimmed_eigenvalues'
283 | p116
284 | g12
285 | (g13
286 | (I0
287 | tp117
288 | g15
289 | tp118
290 | Rp119
291 | (I1
292 | (I4
293 | tp120
294 | g22
295 | I00
296 | S'\xbf\xa5C\x91\xfb\x04\x17@\xe1\xf9-\xc8\xeb\xb6\x0e@\x01\xc4\x060o\xd3\xff?[\x16\x9f\xaaw(\xe8?'
297 | p121
298 | tp122
299 | bsg11
300 | g12
301 | (g13
302 | (I0
303 | tp123
304 | g15
305 | tp124
306 | Rp125
307 | (I1
308 | (I3
309 | I10
310 | tp126
311 | g22
312 | I00
313 | S"\xdd\x02\xb3S\x85l\xdd?\x9f\xee\xd9\x91\xc1W\xb1?\x0f\x0bt\xce\xef\x9a\xc3\xbfR\xce\x84\xc8\r\xedS\xbf\xbf\xf7IAj\xe1\xdf\xbf\xc7\xc5_\xdc:F\xbf?+\x9a\xfb\xcd'\xa9\xd2\xbf\xef+*0\xf2E\xc8?\x90\x94\xcc\xa2\x84\xeb\xde??\xfe\xda%\x8b6\xd8\xbf\xe7\xad\xec\xb8\x07G\xc3?\xf1\r\xf1u\xa3\xc8\xdd?x\x07\xe4\xf03\x17\xd4\xbf\xb2\x93g\x1by(\xcf\xbfy\xc7\xff\xaf\x92\x83\xd0\xbf5M\x8b\x92\x99\xd5\xd7\xbf\xeak\xfe\xd1^\xe6\xd0?\xf7\x043'\x96\xa2\xd3\xbf#\x18\xde\xe4\xc7!\xc4?\x12\x0e\x81\xd1\xc8C\xdd?A#\xad\xf3\xfc(\xd4\xbfL\xdeq\xe1\\[\xcb?=\xb0\xb4E\xf0\xd0\xd9?\xe6\xf1\x13\xcd~\xb9\xa2\xbf\xb7\x1c\x11 oZ\xc1?\xbf\xabv\x87w\x0e\xd8\xbf\x1e\x19\x06E\xa6@\xe3\xbf\x9a\xb9\xee\xc0\x06\x93\xa4?\xeb\x16\xfc\xa7!,\xd8?D\xc7\x8400K\xc4?"
314 | p127
315 | tp128
316 | bsg27
317 | g12
318 | (g13
319 | (I0
320 | tp129
321 | g15
322 | tp130
323 | Rp131
324 | (I1
325 | (I10
326 | tp132
327 | g22
328 | I00
329 | S'\xb6\x9c\x04\x0fq\xf1\x1f@\xc2k\x8e\xb9`\xdcS\xc0\xe9\x9d\xb7\xde\xd0\xf5 \xc0k\xf6-u\xfc\x85C\xc0\xd6\xf6\x8d\x1eqx,\xc0\x0e\xbe\xf7oq\xc1\x07@\x90pt+\x04\xda\x17\xc0:\x8eI\t\x00\xe7E@n\xbf\xbe\xc5E\xb14@\xd3\xe1\x00d\xd3\xedQ@'
330 | p133
331 | tp134
332 | bsS'n_samples'
333 | p135
334 | I3148
335 | sS'_n_active_components'
336 | p136
337 | I3
338 | sbsb.
--------------------------------------------------------------------------------
/pdm_clm_models/pdm_models/g_t_r_eye_2:
--------------------------------------------------------------------------------
1 | ccopy_reg
2 | _reconstructor
3 | p0
4 | (cmenpofit.modelinstance
5 | OrthoPDM
6 | p1
7 | c__builtin__
8 | object
9 | p2
10 | Ntp3
11 | Rp4
12 | (dp5
13 | S'similarity_model'
14 | p6
15 | g0
16 | (cmenpofit.modelinstance
17 | _SimilarityModel
18 | p7
19 | g2
20 | Ntp8
21 | Rp9
22 | (dp10
23 | S'_components'
24 | p11
25 | cnumpy.core.multiarray
26 | _reconstruct
27 | p12
28 | (cnumpy
29 | ndarray
30 | p13
31 | (I0
32 | tp14
33 | S'b'
34 | p15
35 | tp16
36 | Rp17
37 | (I1
38 | (I4
39 | I12
40 | tp18
41 | cnumpy
42 | dtype
43 | p19
44 | (S'f8'
45 | p20
46 | I0
47 | I1
48 | tp21
49 | Rp22
50 | (I3
51 | S'<'
52 | p23
53 | NNNI-1
54 | I-1
55 | I0
56 | tp24
57 | bI00
58 | S"\xd0\xf6'\x90%\xbb\xb8\xbfA/\\\xc3[c\xe3?<\xd1\xce\xa7su\xc9?\xcc\xe8\x1b\x91\x0b-\xcc?\xfb\x01\x86R\xaa\x12\xca?\xf3&N\xdd\x10\x7f\xca\xbf\xc6\x8a\xc309uq?\x8f-fd\xd4\xe0\xe1\xbfS\x18\xf3\x91.\xc9\xc2\xbf\xb7\x81\xa1I\xa1\xdb\xce\xbf\xa8\xdb\xd3i\x06\xed\xc4\xbf\xd2\xb8\xfb\x19\x89#\xc7?C/\\\xc3[c\xe3\xbf\xd2\xf6'\x90%\xbb\xb8\xbf\xcb\xe8\x1b\x91\x0b-\xcc\xbf?\xd1\xce\xa7su\xc9?\xf5&N\xdd\x10\x7f\xca?\xfa\x01\x86R\xaa\x12\xca?\x8f-fd\xd4\xe0\xe1?\x0b\x8a\xc309uq?\xb6\x81\xa1I\xa1\xdb\xce?V\x18\xf3\x91.\xc9\xc2\xbf\xd4\xb8\xfb\x19\x89#\xc7\xbf\xa8\xdb\xd3i\x06\xed\xc4\xbfI,\x0cp\xbd \xda\xbffO`\x08tG\xab<;,\x0cp\xbd \xda\xbf\x90\xcb\xc7d\xf0\xdb\xb3<:,\x0cp\xbd \xda\xbf\xad`]\xae\x8d\xed\x90<5,\x0cp\xbd \xda\xbf\xd8\xd35\xb0\x10\xcf\xb6\xbc;,\x0cp\xbd \xda\xbf+\x0c\xedj\x80K\xb2\xbcB,\x0cp\xbd \xda\xbf\xe2\x1f&\xcc\xbc\x0f\x87\xbc\x16(\x19\xaa\x97E\xb3\xbcG,\x0cp\xbd \xda\xbf|\xf9\xa7v\xef\xeb\xb4\xbc=,\x0cp\xbd \xda\xbf\xe7ZS\xdb\xee\xd8\x91\xbc9,\x0cp\xbd \xda\xbf\xaat\x16\x96\xe1\x9d\xb4<5,\x0cp\xbd \xda\xbf\x04*\xdd\xb0\x85a\xb2<;,\x0cp\xbd \xda\xbf\x16H\x9fD\xf1\xe9\x80,\x0cp\xbd \xda\xbf"
59 | p25
60 | tp26
61 | bsS'_mean'
62 | p27
63 | g12
64 | (g13
65 | (I0
66 | tp28
67 | g15
68 | tp29
69 | Rp30
70 | (I1
71 | (I12
72 | tp31
73 | g22
74 | I00
75 | S'\xa3\xb56