Spaces:
Running
Running
Clamp preset values to expression slider range [-3,3]
Browse files
app.py
CHANGED
|
@@ -514,17 +514,18 @@ with gr.Blocks(title="GNM Head") as demo:
|
|
| 514 |
|
| 515 |
# Expression slider slots (flat order): left eye 0-2, right eye 3-5,
|
| 516 |
# mouth 6-12, tongue 13-16 (13=tongue_mean, 14-16=tongue_000..002),
|
| 517 |
-
# pupil dilation 17.
|
|
|
|
| 518 |
# mouth slot 6 negative -> jaw drops / mouth opens
|
| 519 |
# tongue slot 14 positive + tongue_mean slot 13 negative -> tongue out
|
| 520 |
# eye slot 0 (left) / slot 3 (right): positive -> eye wide, negative -> closed
|
| 521 |
presets = [
|
| 522 |
# 1) Open mouth with the tongue sticking out.
|
| 523 |
-
_preset(expression={6: -
|
| 524 |
# 2) Surprised: eyes wide open + mouth dropped open.
|
| 525 |
-
_preset(expression={0:
|
| 526 |
# 3) Wink: left eye closed, right eye left neutral.
|
| 527 |
-
_preset(expression={0: -
|
| 528 |
]
|
| 529 |
|
| 530 |
gr.Examples(
|
|
|
|
| 514 |
|
| 515 |
# Expression slider slots (flat order): left eye 0-2, right eye 3-5,
|
| 516 |
# mouth 6-12, tongue 13-16 (13=tongue_mean, 14-16=tongue_000..002),
|
| 517 |
+
# pupil dilation 17. Expression sliders are clamped to [-3, 3].
|
| 518 |
+
# Measured directions on this model:
|
| 519 |
# mouth slot 6 negative -> jaw drops / mouth opens
|
| 520 |
# tongue slot 14 positive + tongue_mean slot 13 negative -> tongue out
|
| 521 |
# eye slot 0 (left) / slot 3 (right): positive -> eye wide, negative -> closed
|
| 522 |
presets = [
|
| 523 |
# 1) Open mouth with the tongue sticking out.
|
| 524 |
+
_preset(expression={6: -3.0, 13: -3.0, 14: 3.0}),
|
| 525 |
# 2) Surprised: eyes wide open + mouth dropped open.
|
| 526 |
+
_preset(expression={0: 3.0, 3: 3.0, 6: -3.0}),
|
| 527 |
# 3) Wink: left eye closed, right eye left neutral.
|
| 528 |
+
_preset(expression={0: -3.0}),
|
| 529 |
]
|
| 530 |
|
| 531 |
gr.Examples(
|