Skip to content
 
 

Repository files navigation

Three.js GNM Head Editor

A client-only TypeScript port of the Google GNM v3 head model and the reference Blender editor. It evaluates identity, expression, pose correctives, and four-joint skinning in the browser, then renders the generated head with Three.js.

Run locally

Requirements: Node.js 20 or newer.

npm install
npm run dev

Open the URL printed by Vite (normally http://localhost:5173). There is no application server or API: Vite only serves static local files during development.

npm test
npm run build
npm run preview

The production output is in dist/ and can be served by any static file host.

Model assets

The initial load downloads and decompresses the official 53 MB gnm_head.npz. The browser retains larger uncompressed basis tensors in GPU memory, so a desktop browser with WebGL enabled is recommended.

Official assets are stored in public/gnm/ and retain Google's Apache-2.0 license and attribution. To download and regenerate them:

python3 -m pip install numpy h5py
npm run assets:prepare

The preparation step converts the two Keras HDF5 semantic decoders to a compact NPZ consumed directly by TensorFlow.js. No Python dependency is required to run or build the web app after the assets have been prepared.

Features

  • Full 253-component identity and 383-component expression state
  • Seeded semantic identity and 20-class expression sampling
  • Identity/expression blending and bilateral eye-expression mirroring
  • Neck, head, and independent eye pose controls
  • Official topology, per-corner UVs, texture, and anatomical materials
  • Browser-saved named presets and Blender-compatible JSON import/export

GNM has documented representation limitations inherited from its training data. Review the upstream project before using demographic controls in a product or study.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages