Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 3d35984

Browse files
committed
fix head mode
1 parent f761701 commit 3d35984

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

apps/DeepFaceLive/backend/FaceAligner.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ def on_tick(self):
160160
if state.head_mode or state.freeze_z_rotation:
161161
if fsi.face_pose is not None:
162162
head_yaw = fsi.face_pose.as_radians()[1]
163-
164-
165-
163+
166164
face_ulmrks = fsi.face_ulmrks
167165
if face_ulmrks is not None:
168166
fsi.face_resolution = state.resolution
@@ -173,11 +171,11 @@ def on_tick(self):
173171
x_offset=state.x_offset, y_offset=state.y_offset)
174172

175173
elif state.align_mode == AlignMode.FROM_POINTS:
176-
face_align_img, uni_mat = face_ulmrks.cut(frame_image, state.face_coverage, state.resolution,
174+
face_align_img, uni_mat = face_ulmrks.cut(frame_image, state.face_coverage+ (1.0 if state.head_mode else 0.0), state.resolution,
177175
exclude_moving_parts=state.exclude_moving_parts,
178176
head_yaw=head_yaw,
179177
x_offset=state.x_offset,
180-
y_offset=state.y_offset-0.08,
178+
y_offset=state.y_offset-0.08 + (-0.50 if state.head_mode else 0.0),
181179
freeze_z_rotation=state.freeze_z_rotation)
182180
elif state.align_mode == AlignMode.FROM_STATIC_RECT:
183181
rect = FRect.from_ltrb([ 0.5 - (fsi.face_resolution/W)/2, 0.5 - (fsi.face_resolution/H)/2, 0.5 + (fsi.face_resolution/W)/2, 0.5 + (fsi.face_resolution/H)/2,])

0 commit comments

Comments
 (0)