A friend came to me one day with a wonderfully strange request.
She wanted a magic mirror.
Not just any mirror, but that mirror.
You know the one:
“Mirror, mirror on the wall, who’s the fairest of them all?”

The idea was simple and slightly mischievous:
when someone stands in front of the mirror, it recognizes who they are and responds with personalized compliments. A morale booster. A confidence engine. A tiny bit of everyday magic.
Of course, I said yes.
Hardware: Keeping It Simple
For the first iteration, I wanted to keep the hardware straightforward and accessible:
- Raspberry Pi (started with Model 3, upgraded to Model 4)
- USB webcam
- Simple speakers
Nothing fancy. The magic would live mostly in software.
Very quickly, it became clear that the Raspberry Pi 3 was too weak for real-time face recognition. Between video capture, feature extraction, and comparison, it just couldn’t keep up.
Upgrading to a Raspberry Pi 4 made a huge difference. More RAM, faster CPU. suddenly the whole system felt responsive enough to feel magical instead of awkward.
Face Recognition: Teaching the Mirror Who You Are
For face detection and recognition, I used a Python library called face_recognition. It’s built on top of dlib and does an impressive amount of heavy lifting for you.
The basic idea is elegant:
Training Phase
- Collect a dataset of known images for each person.
- For every image, the library extracts a feature vector that represents the face.
- Store these vectors for later comparison.
We do this for multiple images per person, so the system learns them from different angles, lighting conditions, and expressions.
Detection Phase
- Capture a frame from the webcam.
- Detect the face and compute its feature vector.
- Compare it against all known faces.
- Find the minimum distance – the closest match wins.
This comparison is exhaustive, which means it doesn’t scale infinitely well. To keep things fast, I limited the database to the ten most unique images per person. That turned out to be a good balance between accuracy and performance.
Once that was in place, the mirror could reliably answer the most important question: “Who is standing in front of me?”
Giving the Mirror a Voice
Recognition alone wasn’t enough. A magic mirror shouldn’t print text. It should speak.
For text-to-speech, I needed it to be able tp handle hebrew well and also I wanted control over the voice features. I discovered ElevenLabs, which offers a surprisingly good free API. You describe the kind of voice you want, and the AI generates it.
The specs were to go with something bold:
A deep, sexy voice.
Think Samuel L. Jackson energy, but in Hebrew.
Once the voice was defined, I took an important design decision:
Offline First
All compliments are:
- Predefined per person
- Generated ahead of time
- Downloaded as audio files
This means:
- No latency
- No dependency on an internet connection
- No awkward pauses while the mirror “thinks”
When the mirror recognizes you, it simply plays the right audio file, and delivers your compliment with confidence and gravitas.
The Result
What started as a playful idea turned into a delightful blend of:
- Computer vision
- Embedded hardware
- AI-generated voice
- And just enough theatrical flair
The mirror doesn’t predict the future.
It doesn’t reveal dark truths.
It just looks at you, knows who you are, and reminds you – out loud – that you’re doing pretty great.
And honestly? We could all use a mirror like that.
What’s Left to do
Like any good prototype, the mirror works. but it’s not finished. There are still a few important items on the to-do list.
Make It Look Like It Belongs in a Palace
Right now, everything technically works… but it still looks like a Hobby project.
At some point, all the components need to disappear behind glass and wood and elegance. This is a princess’s house, after all. The final version should feel less like “electronics experiment” and more like “enchanted object that has always been there.”
Cable management, enclosure design, lighting, and mirror integration are all part of that final illusion. If the technology is noticeable, the magic is broken.
Complimenting Strangers (Without Being Awkward)
Currently, the mirror shines brightest when it recognizes a familiar face. But what happens when someone new walks in?
We don’t want the mirror to go silent just because it doesn’t know you yet. On the contrary, it should still be welcoming and flattering.
To do that properly, the mirror would ideally know a few things:
- Gender (important in Hebrew, where compliments are gendered)
- Approximate age range
- Mood (smiling, neutral, sad, surprised…)
With that information, the mirror could generate compliments that feel personal even for first-time visitors:
- Softer encouragement for someone who looks tired or sad
- Playful confidence boosts for someone smiling
- Age-appropriate phrasing that doesn’t feel forced
There are neural networks that can do all of this: gender classification, age estimation, emotion detection. but there’s a catch. Those models are computationally expensive.
Running real-time face recognition is already pushing the limits of what we can comfortably do on a Raspberry Pi hidden behind a household mirror. Adding multiple deep-learning models on top of that would either Tank performance, add noticeable latency or require hardware that’s much harder to hide discreetly
This forces a classic engineering tradeoff: More intelligence vs. more invisibility. None of these are solved yet, but that’s part of the fun.
Leave a Reply