HeWo's Face
HeWo Face Engine is a real-time expressive face renderer built with Pygame — designed to bring characters like HeWo to life through geometry, emotion control, and animation.
Originally conceived as a minimalist face prototype, it has evolved into a full-featured engine capable of handling smooth emotional transitions, blinking, talking animations, and even multimedia overlays.
The package is modular by design, making it ideal for Standalone visual experiments or Integration into robotics pipelines (e.g., ROS 2 nodes)
It runs in real time and can be fully controlled via keyboard or HTTP API.
HeWo’s expressions are not pre-rendered: they’re algebraic. Every eye blink, mouth movement or smile is generated by morphing geometric primitives — fast, lightweight, and customizable.
Installation
To install the package:
pip install hewo-face
To launch the main application:
hewo_face_main
Controls
Keyboard
These controls are available when running the application interactively:
| Key | Action |
|---|---|
SPACE |
Toggle between increase/decrease mode |
1 |
Toggle talking animation |
2 |
Trigger blink |
M |
Set a random facial expression |
N |
Reset emotion to neutral |
V |
Increase face size |
B |
Decrease face size |
↑ ↓ ← → |
Move the face up/down/left/right |
Q–C |
Adjust individual emotion points (mapped) |
In adjust mode, each key from Q to C is mapped to one facial parameter.
Pressing them will increase or decrease the corresponding value depending on the current mode (SPACE toggles it).
API (REST)
If launched with the REST endpoint enabled, the following routes are available:
Routes Summary
| Endpoint | Method | Description |
|---|---|---|
/set_layout |
POST | Switches current layout |
/hewo/set_emotion_goal |
POST | Sets full emotion configuration |
/hewo/adjust_emotion/<param> |
POST | Sets value of a single face point |
/hewo/get_emotion |
GET | Retrieves current face values |
/hewo/adjust_position |
POST | Moves the face by (dx, dy) |
/hewo/set_position_goal |
POST | Moves the face toward an XYZ goal |
/hewo/set_surface_goal |
POST | Moves/rotates the face on the sphere |
/hewo/get_pose |
GET | Retrieves current and target pose |
/hewo/get_position_bounds |
GET | Retrieves current valid XY limits |
/hewo/set_size |
POST | Sets global face size |
/hewo/toggle_talk |
POST | Starts or stops talking animation |
/hewo/trigger_blink |
POST | Triggers a blink |
/hewo/set_random_emotion |
POST | Randomizes all emotion values |
/hewo/reset_emotion |
POST | Resets all emotion values to neutral |
/media/add |
POST | Adds a multimedia object |
/media/move |
POST | Moves multimedia object |
/media/set_position |
POST | Sets exact position of object |
/media/play |
POST | Starts playback |
/media/pause |
POST | Pauses playback |
/media/remove |
POST | Removes object from layout |
Layout API
curl -X POST "$BASE_URL/set_layout" \
-H "Content-Type: application/json" \
-d '{"name": "hewo"}'
🎭 Face API
curl -X POST "$BASE_URL/hewo/set_emotion_goal" \
-H "Content-Type: application/json" \
-d '{"lps":100,"letl_a":0,"letl_b":0,"letl_c":0,"lebl_a":0,"lebl_b":0,"lebl_c":0,"rps":100,"retl_a":0,"retl_b":0,"retl_c":0,"rebl_a":0,"rebl_b":0,"rebl_c":0,"tl_a":0,"tl_b":0,"tl_c":0,"tl_d":0,"tl_e":0,"bl_a":0,"bl_b":0,"bl_c":0,"bl_d":0,"bl_e":0}'
curl -X POST "$BASE_URL/hewo/adjust_emotion/lps" \
-H "Content-Type: application/json" \
-d '{"value": 73}'
curl -X GET "$BASE_URL/hewo/get_emotion"
curl -X POST "$BASE_URL/hewo/adjust_position" \
-H "Content-Type: application/json" \
-d '{"dx": 15, "dy": -10}'
Pose API (XYZ + spherical DOFs)
POST /hewo/set_position_goal accepts any combination of x, y, and z.
X/Y are screen render units, and Z is the projected camera distance. speed
is measured in render units per second. Set speed to 0 or immediate to
true to apply the goal immediately.
curl -X POST "$BASE_URL/hewo/set_position_goal" \
-H "Content-Type: application/json" \
-d '{"x": 320, "y": 180, "z": 760, "speed": 300}'
POST /hewo/set_surface_goal accepts any combination of longitude,
latitude, and roll, all in radians. Its speed is radians per second; use
0 or immediate: true for an immediate change. Latitude is limited to
[-pi/2, pi/2] and the angular values wrap around at pi.
GET /hewo/get_pose returns both the current pose and its active goals.
GET /hewo/get_position_bounds returns the live window size, face size, margin,
and valid inclusive X/Y ranges. The limits are recalculated after a resizable
window changes size; current positions and in-flight XY goals are clamped at once.
On an actual resize, HeWo is recentered and scaled to fit within half the window
while preserving its proportions. Repeated size notifications that do not change
the window dimensions do not alter HeWo's size or position.
curl -X POST "$BASE_URL/hewo/set_surface_goal" \
-H "Content-Type: application/json" \
-d '{"longitude": 0.5, "latitude": -0.2, "roll": 0.1, "speed": 1.2}'
curl -X GET "$BASE_URL/hewo/get_pose"
curl -X POST "$BASE_URL/hewo/set_size" \
-H "Content-Type: application/json" \
-d '{"value": 300}'
curl -X POST "$BASE_URL/hewo/toggle_talk"
curl -X POST "$BASE_URL/hewo/trigger_blink"
curl -X POST "$BASE_URL/hewo/set_random_emotion"
curl -X POST "$BASE_URL/hewo/reset_emotion"
🖼️ Multimedia API
curl -X POST "$BASE_URL/media/add" \
-H "Content-Type: application/json" \
-d '{
"filepath": "/path/to/video.mov",
"position": [100, 200],
"velocity": [0, 0],
"size": [300, 200],
"loop": false,
"audio": true,
"autoplay": false,
"name": "VideoObj1"
}'
curl -X POST "$BASE_URL/media/move" \
-H "Content-Type: application/json" \
-d '{"name": "VideoObj1", "dx": 50, "dy": 20}'
curl -X POST "$BASE_URL/media/set_position" \
-H "Content-Type: application/json" \
-d '{"name": "VideoObj1", "x": 100, "y": 100}'
curl -X POST "$BASE_URL/media/play" \
-H "Content-Type: application/json" \
-d '{"name": "VideoObj1"}'
curl -X POST "$BASE_URL/media/pause" \
-H "Content-Type: application/json" \
-d '{"name": "VideoObj1"}'
curl -X POST "$BASE_URL/media/remove" \
-H "Content-Type: application/json" \
-d '{"name": "VideoObj1"}'
Notes
- All routes assume the app is running at
http://127.0.0.1:8000 - Replace
$BASE_URLwith your actual endpoint address if running remotely. - Current layouts:
"hewo"and"media"— more can be added as needed. - Face points (
lps,tl_a,bl_c, etc.) range from 0 to 100 and define facial expressions.
Metadata
Release files for hewo-face 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hewo_face-1.1.1.tar.gz | 36.0 kB | Without provenance | Details for hewo_face-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hewo_face-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for hewo_face-1.1.1-py3-none-any.whl |
Total release size: 69.9 kB
Release files / hewo_face-1.1.1.tar.gz
| Download URL | hewo_face-1.1.1.tar.gz |
|---|---|
| Size | 36.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a04b1bfc7429019944929d53599cffd34c12fd9003e66e941e4eb28ce5155626
|
|
BLAKE2b-256 checksum How to use checksums |
57c8ed3cbcd351958b12eb9d9e22d3b280b9fc78bfacd562cf464b3cc860483e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Release files / hewo_face-1.1.1-py3-none-any.whl
| Download URL | hewo_face-1.1.1-py3-none-any.whl |
|---|---|
| Size | 34.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b884ee38904d480073305cc35b0d0cdd6bc66e1176c274cc43182f5e0c6a920c
|
|
BLAKE2b-256 checksum How to use checksums |
72c01b683a8b327005fa1f21eb6fdb1d81c3f549eadb5885fafbef9b8c766ea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Security for hewo-face 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.