Zumti Avatar Blog

Three photos in, one 3D head out: where the time goes

We timed every step of a single face build, from upload to finished GLB. Here is the map, and what it taught us.

Left: the Zumti Avatar screen asking for a front, left and right photo. Right: the finished 3D head of an older man with a grey beard.
Three phone photos go in, a 3D head comes out about 100 seconds later. This post is about what happens in between.

When you make a Zumti Avatar, you upload three photos and wait. Behind that wait is a long chain of steps: checking the photos, building the shape of your head, finding your ears, painting your skin, testing the result, and packing it into a game-ready file.

To make that wait shorter, we first had to know exactly where the time goes. So we took one real face build, turned on a profiler, and timed all 48 steps, from the moment the photos leave the server to the moment the finished avatar comes back.

The journey of one face

From three photos to a 3D head, in order

Check the photosOne clear face? Sharp enough? Which side is which profile?
Find 478 face pointsEyes, nose, lips and jaw, on every photo
Solve the head shapeFit a 3D head model to the front photo
Use the side photosPlace a camera for each profile, find the ears
Neck, jaw, ears, foreheadMake the geometry match all three photos
Paint the skinA 2048 × 2048 colour map: tone, hair, beard, eyes, lips
Quality gates16 checks; if a result fails, it is not used
Build the avatar file72 expressions, eyelashes, skeleton, one GLB
Simplified. Every box hides several smaller steps; all 48 were timed.

Where the time went

The profiled run took 365.6 seconds end to end. That is much longer than a normal build: profiling adds overhead, and this run also had an experimental texture pass switched on. That makes it a perfect diagnostic run, because every possible step shows up.

One profiled face build, grouped (365.6 s in total)

Steps whose result was usedExperimental step, result discarded
Texture painting and quality gatesthe colour map we keep, plus 16 checks
101.3 s · 28%
Experimental texture passran, failed its checks, was thrown away
76.2 s · 21%
3D shapehead shape, profile cameras, ears, neck, jaw
61.4 s · 17%
Photo stepsphoto checks, alignment, fitting, export
53.5 s · 15%
Building the avatar fileskeleton, eyelashes, maps, packaging
39.6 s · 11%
Cloud and transferqueue, machine start, uploads, downloads
33.6 s · 9%
Seconds and share of the total. The gold bar is an experimental texture pass that did not pass its quality checks.

Four things the map told us

1. Two thirds of the time is one program

65% of the whole run, about 239 seconds, happened inside a single Python process: the one that actually builds the 3D head. Servers, uploads and machine start-up are a small part of the story. If we want a big speed-up, it has to come from inside the head build.

2. Quality gates sometimes throw work away, on purpose

The experimental texture pass ran for 76 seconds, then failed its checks: the colour difference between the photos and the filled-in areas was 2.54, just over the limit of 2.5, and it covered too little of the center of the face. So the system dropped it and used the proven texture instead.

We would rather throw away 76 seconds of work than give someone a blotchy face. But a step that often fails should not run at all, so that experimental pass was switched off the same evening.

3. The heavy steps are ordinary math, not AI

The steps people usually think of as slow, the neural networks, are only part of it. A lot of time goes into plain number crunching on big arrays: blurring and blending a 2048 × 2048 texture with 3.6 million texels, solving large sparse systems to smooth skin tone, and measuring 16 quality gates on the finished map. That kind of work is a good fit for a faster language, and it is where we are moving code to Rust next.

4. The cloud has moods

Just getting a machine took 23.1 seconds in this run, and 11.9 seconds for the same photos an hour earlier. The difference was entirely on the cloud side. On another day, the same job finished in 102.9 seconds on one processor generation and 245.6 seconds on another: 2.4 times apart. Any single timing is a sample, not the truth, so we compare runs on the same machine type before we trust a speed-up.

The building blocks

For the curious, these are the main libraries doing the work in a face build:

LibraryWhat we use it for
MediaPipeFinding faces and the 478 face points; separating hair, skin and clothes
OpenCVImage work: colour spaces, blurs, warping photos onto the head
NumPy and SciPyThe math: fitting the head model, sparse solvers, smoothing
ONNX RuntimeA model that reads surface direction (normals) from photos
PyTorchSmall networks of our own for ears and beards
glTF-Transform and sharpBuilding, compressing and packing the final GLB file

What changed after the map

  • A 7.4-second check is gone. Every build used to verify its Python packages first. The packages are fixed inside the image, so that check now happens once, when the image is built.
  • The experimental texture pass is off until it passes its gates reliably.
  • The slowest single tool is being replaced. Finding ears in the side photos was the biggest item in production runs. That story has its own post: why we are replacing a giant segmentation model with a tiny one.

A normal production build today takes around 100 seconds. Our next goal is a third of that. The map tells us that no single trick gets us there; it will be a handful of steps, each made a few times faster.

Try it yourself. Make your own 3D avatar from three photos at avatar.zumti.com, or talk to us about avatars in your app or game.