Since 2017, I've been taking a selfie every now and then. In 2024, I turned 229 of them into a 36-second time-lapse (original post). My approach was simple: OpenCV detected the box around the face in each photo, and I cropped every photo with a fixed margin around that box, then put them all together into a video.
It went really smoothly. Genie Code planned the steps, picked the libraries, ran the code and showed me the preview frames I'd asked for. While it worked through the 500 photos, I could step away and come back to finished results.
From there I ran a few short iterations, all of them about how the result looked, not technical details:
My focus stayed on design and feel. Genie Code handled the technical side.
The generated notebook with Genie Code on the right. There's a lot of code generated that I didn't need to review in this context but focus solely on the results.My 2024 version used OpenCV's Haar cascade face detector, which only returns a box around the face. Genie Code chose MediaPipe Face Landmarker instead. It finds 468 facial landmarks, averages 12 points per eye to get each eye's center, and then rotates, scales and shifts every photo so both eyes land on the same fixed coordinates. That gives three improvements:
I love it! The new version has more than twice as many photos as the 2024 one (500 instead of 229), and the extra years show. Over time I got more adventurous with glasses, hats and other headwear, and my look kept changing. Even so, Genie Code (and I!) kept the face in place from frame to frame, so the changes are easy to follow instead of distracting.
Time-lapse of 500 aligned selfies from 2017 to 2026: the face stays in the same position while glasses, headwear and hairstyle change.| 2024 (by hand) | 2026 (Genie Code) | |
|---|---|---|
| Time to the finished video | ~3 days | ~3 hours |
| Lines of code I wrote | 500 | 0 |
| Prompts | n/a | 6 prompts |
| Photos processed | 229 | 500 |
| Aligned on | Face box (OpenCV Haar cascade) | Eye centers (MediaPipe Face Landmarker) |
| Can someone else run it? | Only with my local setup | Anyone with access to the notebook |
I'm sure I could turn this into an app in no time with Genie App Builder (currently in Beta): upload a folder of photos, get the time-lapse back. Once you have such tools available, you can really get creative with what you want to build. What a time to be alive!
Genie Code didn't replace judgment. It replaced setup and boilerplate. I still decided what "aligned" meant, spotted which frames were wrong and said when the result was good enough. It's a super coworker which makes a project like this (and more elaborate ones) quick to take on.
Do I need to know Python to use Databricks Genie Code?
No. I gave plain-language instructions and reviewed the results. Knowing what a good result looks like helps more
than knowing the code. In fact, for this project I didn't read the code at all and just checked the outputs.
Can Databricks Genie Code do image processing?
Yes. In this project it used MediaPipe Face Landmarker to find the eyes in 500 photos, aligned and cropped them,
and rendered a GIF and an MP4.
What is the difference between Genie Code and Genie One?
Today, Genie Code is for technical work such as code, notebooks and pipelines. Genie One is for business users who
ask questions about governed data in plain language.
(Genie docs)
Why run a small personal project on Databricks instead of a laptop?
Mainly because I wanted to build it with Databricks Genie Code, which is built for exactly this kind of data
science and machine learning work: exploring files, choosing models, running code on ML compute and checking the
results. On top of that, there's no setup, the photos stay in governed storage, and the pipeline can be rerun or
shared. And everybody can try it with
Databricks Free Edition!
Disclosure: I work at Databricks. Opinions here are my own.