The Tale of AttendanceLabs.com
The Origin of the Idea
My college is a bit strict around the attendance criteria. We have teachers who take attendance manually. Out of a 50-minute lecture, at least 5 minutes is guaranteed to be spent on the teacher calling out roll names of each student and then that student acknowledging the call (kinda like an inefficient socket that acks sequentially, lol).
We particularly had a teacher who used to get around this by taking a picture of the classroom, like a snapshot of who's in the class at that particular moment. He would then call a student to his staff room to verify the students were being marked correctly. It was all fine until he selected me.
I manually had to find 70 student names and make sure they were marked correctly.
This is where it all started: The Problem, followed by the IDEA!
The Exploration
I was aware of a few tools that can face map you from a bunch of photos with a few faces, apart from Google Photos doing it, but I always thought it would be hard because it required knowledge of ML and heavy statistical mathematics. Then to further trim the problem down, I started looking into how difficult it actually is and what it takes to learn it.
The key findings: To use a model (locally too) you don't need to learn how that model works. It's often as easy as calling a library function. For most cases it's:
1model = import_the_heavy_model()
2prediction = model.predict("image_of_mango")
3print(prediction) # mangoYeah, that's how easy it is to use a model. But the main architecting and engineering comes in how you manage the data in complex detection scenarios. Like with face detection, you often get multidimensional vectors instead of hardcoded "text" outputs which are easy to interpret.
The Inference Logic
I did some research and brainstorming and was lucky enough that InsightFace exists! They basically provide you with the boilerplate with all the ML stuff and simplify your process of using or training a model.
1model = A_face_recog_model()
2vect = model.get_face_embedding("face.png")
3# vect is a multidimensional vector for the particular face.pngThe model gives you a multidimensional vector for any face you provide it. In reality, it looks something like [0.23, -0.87, 0.12, 0.45, ..., -0.31] — hundreds of numbers. But think of it as a "label" that is numeric.
Suppose we gave the model three faces, and here's what it returned:
| Person | Vector (let's assume) |
|---|---|
| Sam | 0.5 |
| Sundar | 0.8 |
| Andrej | 0.2 |
Now the next time you get a 0.5 from a face you gave to the model, you know it's Sam. Even for 0.48 or 0.51 you can assume it's Sam, just maybe with a different expression or look.
In the world of vectors, you can use simple mathematical formulas to estimate how close two vectors are and make a conclusion. This is the core logic that runs the main engine inside attendancelabs.com. I used Qdrant for storing the vectors, which is a database specifically built around vector storage, further making things easy.
The Design
Now that the main core logic was determined, I did some testing by asking for my friends' photos and running everything with a scrappy Python script. The logic was ready to solve the problem.
The basic architectural design I came up with was:
| Layer | Tech | Purpose |
|---|---|---|
| ML Engine | Flask | Face embedding microservice |
| Backend | Django | CRUD dashboard |
| Frontend | Next.js + Tailwind | UI/UX |
| Database | Qdrant | Vector storage |
And with a few stirs by the chef (me), the dish was ready in ~18 days.
The Aftermath
The nightmare for every builder is distribution. This is where I struggled. When the app was built, I was too overwhelmed and just unsure about keeping it alive forever. I got massive validation from my friends, a few people saying this could be a good business idea, but in the long run I was quite unsure about where it was heading. I was still early in my career and decided to sunset it. Before I could pitch it to make it a real solution in teachers' lives, I was hesitant to create a dependency. I don't want to create problems, I like to solve them.
The Learning
Building is easy, distribution is hard, motivation to keep working on things is hard. I was confident that I was now officially full-stack beyond just hobby projects, and I decided to sunset the project despite the micro-launch on LinkedIn a few months after building it.
Check out the project produ....ex-product! at attendancelabs.com.