AI-Tagged Image Gallery — Kreative
LiveRebuilt Kreative's internal stock-image gallery so you could actually find things in it — a self-hosted BLIP auto-tagging pipeline that tagged all 38,504 images in under 20 minutes, plus a brand-new tag-driven search that replaced the old numeric-ID lookup.
- Role
- Full-stack web developer at Kreative
- Timeline
- Summer 2026
- Stack
- Python
- Django
- BLIP
- Hugging Face
- Computer Vision
- Search
The problem
The gallery was technically a search tool but functionally a lookup: the only query it supported was by exact numeric image ID. Anyone who didn't already know the ID of the image they wanted had no way to find it short of scrolling 38k+ images across 54 folders. For a stock-image tool staff reach for every day, that's the opposite of what the tool is supposed to do.
The approach
Rather than bolt a description field onto every image and ask the team to backfill tens of thousands of them by hand, I built a Python script that runs BLIP (Salesforce's open-source vision-language model, self-hosted via Hugging Face) over the existing library, turning each image into a structured set of descriptive tags saved to a new Django model. On the application side I replaced the ID-match search view with one that queries the tags, ranked by how many search terms match — so a query like "beach sunset" actually returns beach-and-sunset images, with zero backfill effort from humans.
Implementation highlights
- Self-hosted BLIP-large pipeline running fp16 inference with batch size 16 and 12 parallel downloads on a single RTX 3060 Ti — ~30–60 images/sec, a full cold run of 38,504 images in roughly 10–20 minutes.
- Idempotent by design: the script skips anything already tagged, so incremental re-runs only pay BLIP time on genuinely new images.
- Normalised tags into a dedicated Django model with a many-to-many relation to images, so tag queries stay fast and tags can be reused, aliased, and curated over time.
- Rewrote the gallery's search endpoint to rank by tag-match count, with fuzzy fallbacks when a query yields no direct matches.
- Admin tooling to re-run tagging on a single image or a slice of the library — useful when the model prompts get tweaked or new images come in.
- Kept everything on-prem: no stock imagery ever leaves the company's infrastructure to be tagged.
Outcome & lessons
After the run: 100% of the 38,504 images had both tags and a short description, averaging 7.9 tags per image (range 3–13), with zero recorded fetch failures. The gallery went from "I need to remember an ID" to "I search for what I'm looking for" overnight, with no manual tagging work. Beyond the immediate UX win, the tags table is a foundation other features can build on — filtered browsing, duplicate detection, suggested related images — since the hard part (structured content about every image) is already done.
Want to chat about this work, collaborate, or just say hi? Reach out.