The front window of our house watches the street this Halloween. Three eyes, one to a pane, rear-projected onto the glass by a laser projector on the living room floor. They sleep when the walkway is empty. When a trick-or-treater starts up the path, all three snap open, and each one follows its visitor to the door. Once the porch empties, they close one at a time and go back to sleep.

The division of labor was clean. I contributed the imagination, the picture of a person standing on that walkway while something huge watches them. My AI assistant contributed the engineering: the pipeline, the tracking, the tests, the discipline of finishing a real-time system in three weeks. There is an earlier essay about teaching this assistant to reach and to remember. This is what that investment looks like when the deliverable is a show.

Halloween night: the show from out front.

The Idea and the Deadline

The first plan, dated September 24, was a different show: a projected skeleton that mirrored your movements as you walked up. Two weeks later I shelved it. A skeleton needs a whole body to read from the street, and a body needs a rendering pipeline there was no time to make good. An eye only has to look at you, and everyone on the walkway knows what that means.

The deadline did most of the architectural work. Show night is Saturday, October 31, dark by six. Our cast is a fisheye camera already hanging above the door, a Raspberry Pi with a Hailo AI accelerator, a spare MacBook Air, and a projector I had to buy. Silence is part of the design, and so is a dim porch. Dim to us, that is: an infrared flood under the eaves lights the walkway for the camera alone.

The Shape of the System

There are five moving parts: the Pi I named sees, the Mac, Chrome as the renderer, the projector, and a notebook running the dashboard. Each talks to the next in the simplest way that could work.

Diagram of the show: visitors, the sees Pi, the show Mac, Chrome, the projector, the window and the notebook dashboard, joined by labeled arrows. Badges 1 to 5 mark the five parts.

The five numbered parts and the paths between them.

The sees Pi owns the seeing. It runs a YOLOv8s pose-estimation network about 20 times a second. A plain HTTP request gets back a small JSON snapshot: each person as a bounding box plus 17 body keypoints (shoulders, ankles, face). Keypoints, not video, cross the Wi-Fi. Video would take megabits per second; a snapshot with one person on the walkway is a few hundred bytes.

The Mac’s bridge polls the Pi for that snapshot 40 times a second, twice the camera’s rate, on a fixed grid timed from the start of each poll, so a slow wireless round trip never stretches the interval. Polling is dumber than streaming, which suits a flaky wireless link. When the Pi stops answering, the bridge backs off exponentially and heals on the next good frame.

One thread on the Mac owns everything that thinks. Thirty times a second it drains the polled frames through a perception layer, a tracker, and the mind, which decides what each eye does. Then it publishes one snapshot of the whole show, carrying every eye’s mode, gaze target, mood levels, and any one-shot action in flight. Each snapshot is complete rather than incremental, so a renderer that reconnects needs nothing else, and a slow client gets skipped, never waited on.

The snapshots travel to the renderer over Server-Sent Events, the browser’s built-in push channel, one message per publish. Here is a real message, from a synthetic visitor walked through the actual mind code, abridged to the left eye:

{
  "v": 1, "seq": 241, "t_show": 1012.05, "blackout": false,
  "eyes": [
    {
      "id": "left", "mode": "track",
      "target": { "yaw": 17.042, "pitch": -6.0,
                  "vyaw": 0.352, "vpitch": 0.0 },
      "mood": { "open": 0.2212, "scowl": 0, "squint": 0, "smug": 0,
                "pupil": 1.0, "red": 0.25, "tremble": 0,
                "blink_rate": 1.0 },
      "action": { "kind": "surprise", "id": 1,
                  "t_start": 1012.05, "delay_ms": 98,
                  "dur_ms": 1291 }
    }
  ]
}

Angles are degrees in the unmirrored view from outside the window: yaw runs side to side, positive to the viewer’s right, and pitch runs up and down. The middle and right eyes carry the same action with delays of 80 and 9 milliseconds, so all three open on the same tick without moving in lockstep. To the renderer, only the sequence number advancing shows the mind is alive; an open connection proves nothing. A stalled mind therefore puts the eyes to sleep just as a dropped stream does.

The renderer is Chrome in kiosk mode, pointed at the projector, running a plain canvas page that draws at animation-frame speed. Measured on site, it held 120 frames per second, and 99 percent of frames took 9.4 milliseconds or less.

My assistant ported the motion model from Adafruit’s M4_Eyes, the animated eyes for their Monster M4sk board (Burgess, 2019). Saccades, the quick jumps a real eye makes, take 83 to 166 milliseconds. Blinks close in 36 to 72. We kept Phil Burgess’s timing numbers because they were tuned by someone who wanted exactly what I want: an eye that looks alive.

Where You Are Is the Hard Part

Drawing the eye was never the hard problem. The hard problem is knowing where a person is when your only witness is a fisheye lens eight and a half feet up. Image coordinates mean nothing to an eye that has to look at a real person on a real walkway.

So we fitted the ground instead of assuming it. We taped marks on the walkway at known positions, photographed them through the fisheye, and fit an image-to-floor mapping that recovers all eight marks to within 2.7 inches. Every detection’s feet go through that map into a door distance. The slope of that distance over the last 0.8 seconds, by least squares, is the radial speed: how fast the person approaches or leaves. Those two numbers are what the mind reads.

The camera's view down the walkway, with taped ground marks labeled X1 to X5, inner X3, outer X1, outer X3 and the doormat.

What the camera sees: the taped marks behind the ground fit. The doormat was held out as a check.

A person’s ground position can come from confident ankle keypoints or from the bottom of the bounding box, and the two estimates flip back and forth when ankle confidence sits at the threshold. On synthetic flicker, that oscillation produced 8.5 degrees of gaze jitter near the door. The fix is a learned offset that follows the confident ankles, which removes the jump at its cause instead of smoothing over the symptom.

What the Mind Decides

Flowchart of the mind: asleep, surprise, watch, the door visit and wink, a turn-back and smug look, settle, with double take and calm as side branches.

What the mind does with one visitor, from the walkway to the door and back.

The mind is a small set of rules about people, most of them there to keep the show from being wrong in front of an audience. A person counts only after repeated sightings within half a second, so a single flickering detection never wakes anything. Once confirmed, a person moves through phases (arriving, at the door, leaving), judged by radial speed rather than position, so standing on the doormat reads as standing still. One second within 1.2 meters of the door counts as reaching it.

The mind also assigns attention so the gazes never cross: arrivals outrank leavers, the top three visitors are matched to the panes from left to right, an eye keeps its person for at least a second and a half, and the nearest visitor takes any spare eye.

The gaze itself is geometry. Yaw is the real angle from a pane to its person, scaled by a gain. That gain defaults to one half: zero is the Mona Lisa, one is a real eyeball. A walking visitor’s gaze aims ahead of them, in proportion to their speed, which covers part of the pipeline’s latency, an estimated 220 milliseconds end to end. The gain is a live dashboard control, tuned on the real walk.

Then the repertoire. Asleep is the default. After 10 seconds of quiet, a stir comes every 10 to 20 seconds: one or two eyes crack open and look around, never all three, because a porch that is already awake cannot surprise the next person who walks up. That person, the first visitor after 10 quiet seconds, gets a Surprise: all three eyes open and the gaze snaps to them. Watch follows, and the scowl builds with door distance.

Three stills of the eyes above a ruler in meters from the door: no scowl at 5, a half scowl at 3.1, a full scowl at 1.2. Bars mark the 2.5 meter wave zone and the door zone.

A walk up the path: the scowl starts at 5 meters and is full at the door.

A second visitor gets a double take. A visitor who reaches the door gets a wink on the way out. A visitor who turns back before the door gets a smug look. A wave from a visitor within 2.5 meters of the door calms the whole show: all three eyes drain shut while still watching, stay shut for 15 seconds, and wake sooner if another group arrives. That behavior shipped behind a dashboard switch, off by default, because a gesture detector that has never seen a dark Halloween crowd has not earned the right to fire on its own.

Six labeled stills: asleep, stir, surprise, double take, wink and smug.

The rest of the repertoire.

The Projector and the Mirror

The projector is a ViewSonic LS740HD: 1080p DLP, laser phosphor, instant on and off (ViewSonic, n.d.). Instant on matters more than any other spec, because the show stops and starts constantly during tuning. ProjectorCentral, a projector review site, measured the brightness at 4,783 ANSI lumens (Kahl, 2024), which by our arithmetic is about eight times more light than a 1.73-meter image through window glass needs.

The most confusing bug of the project was a flip. Rear projection needs exactly one horizontal mirror of the picture: either the projector flips it or the page does, never both and never neither. Our dry run, one week before the show, ran with no picture flip at all. Worse, the browser had remembered a gaze flip, a separate mirror for the gaze alone, from an earlier test, and the eyes tracked the wrong way.

The launcher now states the gaze flip explicitly on every start, the page owns the picture flip, and the saved alignment records which flip it was aligned under. Software cannot read the projector’s menu, so the only real test is to walk the walkway yourself and watch what the eyes do.

Testing a Show, Not a Demo

Nothing here can be validated by watching it work once. The failure modes are crowds, darkness, a camera that wedges, a Pi that reboots, a browser tab that throttles. Every recorded walk on the real walkway replays through the real mind at the real event rate, so a behavior change faces recorded visitors before it faces live ones.

Under that sits a catalog of named synthetic scenes in eight families, replayed through the real perception and mind code. A runner exits with code zero only when every scene still behaves. Two dark-porch failures get their own scenes: a camera that slows to a crawl and misses a visitor, and a flickering detection that wakes the eyes for no one.

The renderer’s modules are pure functions over plain state, so they run under node: 139 JavaScript tests with coverage floors. On the Python side there are 452 tests, and the last full run before the show passed at 94 percent coverage. A three-hour soak drove the real stack against a replayed walk with the show’s own client load, plus injected faults: the Pi vanishing, lag spikes, dark frames. The pipeline recovered from all of them, the rate held at 30 hertz, and the watchdog, which restarts a stalled server, never had to fire.

The dashboard on the notebook polls the show’s health once a second, with strips for the display, the renderer, the camera and the lights, and chimes when something goes red. Nothing auto-restarts Chrome. That was my call: a human is on hand all night, and the dashboard’s job is to make a failure visible fast, not to survive it.

The Night Before

I am writing this on the Friday before the show, with the dry run a week behind us and one setup evening left. The eyes are aligned to their panes, the wave detector is measured, and the runbook is printed. My assistant built the machine. I held the gates.

Halloween is the one night a year a house is allowed to look back. Tomorrow evening the porch light will go off, the window will wake, and three eyes will settle into their panes to wait. They will know the moment the first costume turns up the walk. They always look.


References