Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
py-3d-face-reconstruction
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
py-3d-face-reconstruction
Commits
be4ae8da
Commit
be4ae8da
authored
Jul 30, 2016
by
Richard Torenvliet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the code that generated the texture PCA model
parent
31abc3e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
src/aam.py
src/aam.py
+5
-1
src/main.py
src/main.py
+18
-7
No files found.
src/aam.py
View file @
be4ae8da
...
...
@@ -195,6 +195,10 @@ def build_texture_feature_vectors(files, get_image_with_points, MeanPoints, tria
list: list of feature vectors
"""
mean_texture
=
[]
image
,
points
=
get_image_with_points
(
files
[
0
])
MeanPoints
.
get_scaled_points
(
image
.
shape
)
x
,
y
,
w_slice
,
h_slice
=
MeanPoints
.
get_bounding_box
()
for
i
,
f
in
enumerate
(
files
):
...
...
@@ -211,7 +215,7 @@ def build_texture_feature_vectors(files, get_image_with_points, MeanPoints, tria
sample_from_triangles
(
image
,
Points
.
get_scaled_points
(
image
.
shape
),
MeanPoints
(
image
.
shape
),
MeanPoints
.
get_scaled_points
(
image
.
shape
),
triangles
,
dst
)
...
...
src/main.py
View file @
be4ae8da
...
...
@@ -96,21 +96,32 @@ def save_pca_model_texture(args):
assert
args
.
model_shape_file
,
'--model_texture_file needs to be provided to save the pca model'
assert
args
.
model_texture_file
,
'--model_texture_file needs to be provided to save the pca model'
Vt
,
s
,
n_components
,
mean_shape
,
triangles
=
pca
.
load
(
args
.
model_shape_file
)
shape_model
=
pca
.
PcaModel
(
args
.
model_shape_file
)
MeanPoints
=
aam
.
AAMPoints
(
normalized_flattened_points_list
=
mean_value_points
,
actual_shape
=
(
58
,
2
)
)
mean_points
=
imm
.
IMMPoints
(
points_list
=
shape_model
.
mean_values
)
#reconstruction.reconstruct_texture(
# input_image, # src image
# input_image, # dst image
# texture_model,
# input_points, # shape points input
# mean_points, # shape points mean
#)
# old
#Vt, s, n_components, mean_shape, triangles = pca.load(args.model_shape_file)
textures
=
aam
.
build_texture_feature_vectors
(
args
.
files
,
imm
.
get_imm_image_with_landmarks
,
MeanPoints
,
triangles
args
.
files
,
imm
.
get_imm_image_with_landmarks
,
mean_points
,
shape_model
.
triangles
)
mean_texture
=
aam
.
get_mean
(
textures
)
_
,
s
,
Vt
,
n_components
=
pca
.
pca
(
textures
,
mean_texture
)
pca
.
save
(
Vt
,
s
,
n_components
,
mean_texture
,
triangles
,
args
.
model_texture_file
)
pca
.
save
(
Vt
,
s
,
n_components
,
mean_texture
,
shape_model
.
triangles
,
args
.
model_texture_file
)
logger
.
info
(
'texture pca model saved in %s'
,
args
.
model_texture_file
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment