All articles

Guides

Build event & wedding photo face-tagging (find-my-photos)

The feature guests love — built consent-first, for photographers and event platforms.

By SightRadar EngineeringUpdated 9 min read Markdown

TL;DR

For a gallery where guests upload a selfie to find their photos: batch-index the event's photos into a per-event collection, let each guest search with a selfie, and delete the collection when the event's retention window ends. Two consent moments matter — the organizer needs a lawful basis to index attendees' faces from the photos, and each guest's selfie upload consents to the search. This guide builds both, end to end.

A photographer shoots 4,000 frames at a wedding. Guests want the 30 they're in. Face search turns that from hours of scrolling into a selfie and a tap — the highest-fit use case for a face API. Done right it's privacy-respecting: the organizer discloses face-tagging up front and sets a retention window, and each guest chooses to search by uploading their own selfie.

Note: Indexing attendees' faces from event photos is itself biometric processing — it needs a lawful basis and up-front disclosure, not just the guest's later selfie upload. Uploading a selfie consents to the *search*, not to the prior enrollment. Have the organizer notify attendees that photos will be face-tagged, and offer a way to opt out / request removal.

The flow

  1. Organizer uploads the gallery; your backend stores originals and queues indexing.
  2. Batch index all photos into a collection named for the event.
  3. Guest opts in — uploads a selfie with a clear consent checkbox explaining it's used only to find their photos in this event.
  4. Search returns the guest's matching photos, ranked; reveal confident matches, gate borderline ones behind a confirm step.
  5. Retention — delete the collection and originals when the agreed window closes.
import os, requests
BASE = "https://api.sightradar.com"
H = {"Authorization": f"Bearer {os.environ['SR_API_KEY']}"}

def index_gallery(event_id, photos):  # [(photo_id, url), ...]
    requests.post(f"{BASE}/v1/collections", headers=H,
                  json={"collection_id": event_id})
    for i in range(0, len(photos), 1000):
        chunk = photos[i:i+1000]
        requests.post(f"{BASE}/v1/batches",
            headers={**H, "Idempotency-Key": f"{event_id}-{i}"},
            json={"collection_id": event_id, "op": "index",
                  "photos": [{"external_id": p, "url": u} for p, u in chunk]})
Up to 1,000 photos per batch; results arrive per-photo on your webhook.

Tip: Guests upload iPhone selfies, which are HEIC. SightRadar decodes HEIC and WebP natively, so you don't need a transcode step before search — one less pipeline stage than a JPEG/PNG-only API forces.

def guest_search(event_id, selfie_url, guest_id):
    record_consent(guest_id, event_id)  # store opt-in before the biometric op
    r = requests.post(f"{BASE}/v1/collections/{event_id}/search",
                      headers=H, json={"url": selfie_url, "limit": 100})
    d = r.json()
    if d.get("reason"):  # e.g. no_face / low_quality_selfie — not charged
        return {"error": "Please upload a clearer selfie."}
    # 'auto' matches reveal now; 'review' matches go behind a confirm step
    return [(m["photo_id"], m.get("tier", "auto")) for m in d["matches"]]

Delete when the event ends

Set a retention window with the organizer and honor it. When it closes, delete the collection (removing indexed faces) and the stored originals. This is both good privacy and a selling point you can put in front of couples and clients.

Note: Keep this to opt-in, user-initiated search. Don't repurpose an event index for cross-event matching or identifying people who never opted in — that breaks the consent model this feature depends on.

Index a sample gallery and try a selfie search on trial credits.

Start with the quickstart

Frequently asked questions

How do guests find their own photos at an event?

Index the event's photos into a per-event collection, then let each guest upload a selfie to search that collection. The API returns the photos they appear in, ranked by similarity, which you map back to your gallery. Because each guest uploads their own selfie to opt in, it's a consent-first, user-initiated workflow.

Do I need to convert iPhone HEIC photos before indexing?

Not with SightRadar — it decodes HEIC/HEIF and WebP natively, along with JPEG, PNG, TIFF, GIF, and BMP. That removes the transcoding step that JPEG/PNG-only APIs like AWS Rekognition force for iPhone selfies and modern CDN images.

How long should I keep the face data?

Only as long as the event needs it. Agree a retention window with the organizer, then delete the collection (which removes the indexed faces) and the stored originals when it closes. Short retention is both good privacy practice and a feature you can advertise to clients.

Keep reading