Skip to content
The Cloud Guy
ATC-015 AWS Guide

Culling 2,500 swim-meet photos with AI, without recognizing anyone

A free local pass for blur and bursts, then a cloud pass for closed eyes on Rekognition, Azure Face or a small vision model. Costs, limits and privacy rules.

Published
Reading time
6 min
On this page
  1. The rule: detect, never recognize
  2. The pipeline
  3. Stage 1: a free pass on the laptop
  4. Stage 2: the cloud pass, three ways
  5. What it costs
  6. What I’d use
  7. A privacy checklist for photos of children

I shoot photos for a youth sports team as a volunteer. A swim meet or a water polo game easily means 2,500 frames, and the families end up with a few hundred in the private gallery. Most of the culling in between is mechanical: this one is soft, that one has the eyes shut, and here are eight nearly identical frames of the same turn.

That mechanical part is exactly what software is good at. Picking the moment that matters still needs a person. This is how I’d split the work, what each cloud offers for the middle step, and the privacy rules that come first when every subject is a child.

The rule: detect, never recognize

The software may look for faces in order to judge the photo: are the eyes open, is the face sharp, is it hidden behind a splash. It must never work out who anyone is. That means no face collections, no face IDs and no stored face data. Every service below can be used this way, but you have to choose it deliberately.

The pipeline

Camera card every frame from the meet Local pass, on the laptop sharpness score, burst groups · free Cloud pass, survivors only eyes, subject blur, framing · cents Review list, best first nothing is deleted You pick the moments the part a model can’t do Drive folder → gallery as in ATC-005 no face is identified or stored at any step
The free pass does the bulk of the work, so the paid pass only sees what’s worth a second look.

The order matters for cost as much as for privacy. The cheapest, most private computer is the laptop the photos are already on, so it does the first pass. Only the frames that survive go to a cloud service, and a person makes the final choice.

Stage 1: a free pass on the laptop

Two simple measurements remove a lot of frames before anything leaves the laptop.

Sharpness. Run a Laplacian filter over a downscaled grayscale copy and take the variance. A sharp image has strong edges and a high score; a soft one scores low. It’s crude, but it’s free and fast, and it catches missed focus and heavy motion blur.

Bursts. A difference hash (dHash) turns each image into a 64-bit fingerprint, and frames from the same burst differ by only a few bits. Walk the photos in shooting order, start a new group whenever the fingerprint jumps, and put the sharpest frame of each group at the top of the list.

"""First-pass photo cull, run locally before upload: drop blurry shots, keep the sharpest of each burst."""
import csv, sys
from pathlib import Path

import imagehash
import numpy as np
from PIL import Image

BLUR_THRESHOLD = 60.0   # variance of the Laplacian below this = too soft (tune on your own camera)
BURST_DISTANCE = 10     # dHash bit difference at or below this = same moment


def sharpness(img: Image.Image) -> float:
    """Variance of the Laplacian on a downscaled grayscale copy. Higher means sharper."""
    g = np.asarray(img.convert("L"), dtype=np.float32)
    lap = (-4 * g[1:-1, 1:-1] + g[:-2, 1:-1] + g[2:, 1:-1] + g[1:-1, :-2] + g[1:-1, 2:])
    return float(lap.var())


def main(folder: str, out_csv: str) -> None:
    rows, prev_hash, burst = [], None, 0
    photos = sorted(p for p in Path(folder).iterdir() if p.suffix.lower() in (".jpg", ".jpeg"))
    for path in photos:  # camera file names sort in shooting order
        with Image.open(path) as im:
            im.thumbnail((1024, 1024))
            score, h = sharpness(im), imagehash.dhash(im)
        if prev_hash is None or h - prev_hash > BURST_DISTANCE:
            burst += 1
        prev_hash = h
        rows.append({"file": path.name, "burst": burst, "sharpness": round(score, 1)})

    best = {}
    for r in rows:
        if r["sharpness"] >= BLUR_THRESHOLD and r["sharpness"] > best.get(r["burst"], (None, -1))[1]:
            best[r["burst"]] = (r["file"], r["sharpness"])
    keep = {f for f, _ in best.values()}
    for r in rows:
        r["keep"] = r["file"] in keep
        r["reason"] = "" if r["keep"] else ("blurry" if r["sharpness"] < BLUR_THRESHOLD else "weaker shot in burst")

    rows.sort(key=lambda r: (not r["keep"], -r["sharpness"]))  # best first: keepers, sharpest at the top
    with open(out_csv, "w", newline="") as f:
        w = csv.DictWriter(f, fieldnames=["file", "burst", "sharpness", "keep", "reason"])
        w.writeheader()
        w.writerows(rows)
    print(f"{len(rows)} photos, {len(keep)} kept for review, {len(rows) - len(keep)} set aside")


if __name__ == "__main__":
    main(sys.argv[1], sys.argv[2])

It needs pip install pillow numpy imagehash, and it reads both .jpg and .JPG files. On a test set of four bursts, with one soft frame in each burst and one whole burst out of focus, it kept the sharpest frame of each in-focus burst, set everything else aside, and listed the keepers first.

Three things to know before trusting it:

  • Tune the threshold on your own camera. Sharpness scores depend on resolution, noise and subject. Score a few dozen photos you’ve already judged by eye, and set the threshold just below the soft ones.
  • It only writes a list. Nothing is deleted. “Weaker shot in burst” means “look at the best one first”, not “throw this away”. Two frames of the same burst can both be keepers.
  • It judges the frame, not the subject. A sharp background behind a blurred swimmer can still score well. That’s what the cloud pass is for.
  • A slow pan can merge moments. Each frame is compared with the one before it, so a gradual change can chain two moments into one group. Since nothing is deleted, that only costs you a second look.

Stage 2: the cloud pass, three ways

The survivors need judgment the laptop can’t give cheaply: are the main subject’s eyes open, is the face itself sharp, is it hidden by water.

AWS: Rekognition DetectFaces

DetectFaces returns, for each face it finds, an EyesOpen value with a confidence score, plus face-level brightness and sharpness, head pose and whether the face is occluded. It’s the only one of the two face services that answers the eyes question directly.

On privacy, it’s a good fit: AWS documents DetectFaces as stateless, with nothing persisted. Face vectors are only created if you call IndexFaces to add faces to a collection, so never call it. Two settings matter:

  • Request only the attributes you need, such as EYES_OPEN and FACE_OCCLUDED. “All attributes” also returns estimated age, gender and emotions, and you don’t want those about anyone’s child. Some fields always come back, including face landmark coordinates. Use what you need from the response and discard the rest, landmarks especially.
  • Opt out of service improvement. Rekognition may store and use inputs to improve the service unless you opt out with an AWS Organizations AI services opt-out policy. Turn it on before the first meet.

Azure: Face detection

Azure’s Face service detects faces and returns blur, exposure, noise, occlusion and head pose. Microsoft retired emotion and gender detection and restricts age and smile. Detection without a face ID creates no template, and Microsoft says images aren’t stored after analysis. returnFaceId defaults to true, so set it to false explicitly.

Two limitations matter here. There’s no eyes-open attribute: occlusion tells you something covers the eye, not that it’s closed. And access is restricted. Microsoft’s Limited Access page says face detection is available without registration, while the Face documentation says the service is only available to Microsoft-managed customers and partners, so check your eligibility before you design around it.

Also note that Azure’s broader Image Analysis API (versions 3.2 and 4.0) is being retired on September 25, 2028, so don’t start anything new on it.

Either cloud: a small vision model

The third option skips face APIs entirely: send each survivor, downscaled, to a small multimodal model with a narrow question, and ask for a structured answer.

You review sports photos for a volunteer photographer. For the main subject only, answer in JSON:
{"eyes": "open|closed|hidden", "subject_sharp": true|false, "subject_cut_off": true|false,
 "face_blocked_by_water": true|false, "keep_score": 1-5}
Do not describe or identify any person.

A model understands context the face APIs don’t. A swimmer in goggles has “hidden” eyes, not closed ones. A water polo player half-covered by a splash may still be the best shot of the game. It also returns only the judgment, not measurements of anyone’s face.

Claude Haiku 5.5 is available on both Amazon Bedrock and Microsoft Foundry. A 1024-pixel image comes to roughly 900 to 1,050 input tokens, so with the prompt each photo is about 1,400 input tokens and 100 output tokens. That output figure assumes extended thinking is off or set low. It’s on by default for Haiku 5.5 on Bedrock, and thinking tokens bill as output, so set it explicitly.

What it costs

At list prices, before any free allowance:

Option Per 1,000 photos Per 2,500-photo meet
Rekognition DetectFaces $1.00 $2.50
Azure Face detection $1.00 $2.50
Claude Haiku 5.5, standard about $0.19 about $0.48
Claude Haiku 5.5, batch (Claude API) about $0.10 about $0.24

Some details:

  • Azure’s free tier allows 30,000 Face transactions a month at 20 per minute, which covers several meets if you can wait about two hours per meet for results.
  • Rekognition also sells a frame-level sharpness check (DetectLabels with image properties) for another $0.75 per 1,000. The local pass does that job for free.
  • Batch on Bedrock: the Bedrock model card for Haiku 5.5 lists batch inference as not supported, so the batch price above is through Anthropic’s own API.

And all of it applies only to the survivors of the local pass, so the real bill is smaller still.

What I’d use

The free local pass first, always. Then Claude Haiku 5.5 for the judgment step: it’s the cheapest per photo, it handles goggles and splashes, and it works the same on either cloud. If I wanted a deterministic eyes-open score rather than a model’s opinion, Rekognition’s DetectFaces is the one that provides it.

A privacy checklist for photos of children

  • Detect, never identify: no face collections, no IndexFaces, no face IDs
  • Never request age, gender or emotion estimates
  • Store only the scores you need, such as “eyes closed” or “sharp”, never face landmarks or measurements
  • Send downscaled copies, not originals, and delete them after the run
  • On AWS, turn on the AI services opt-out policy before the first upload
  • Tell the families, and get parents’ or guardians’ consent for any automated processing
  • Check the biometric privacy rules where you live. Illinois’s law excludes photographs themselves, but not scans of face geometry made from them. Texas’s covers face geometry captured for a commercial purpose. Treat anything that measures a face as sensitive. (This isn’t legal advice.)

Status and prices as of November 2026. Sources: Rekognition DetectFaces, Rekognition FaceDetail, Rekognition FAQ, AI services opt-out policies, Rekognition image properties, Rekognition pricing, Azure Face detection, Face Limited Access, Face data privacy, Image Analysis retirement, Face API pricing, Claude vision, Claude pricing, Haiku 5.5 on Bedrock, Claude models in Foundry, imagehash, Illinois BIPA, Texas Business and Commerce Code 503.

  • aws
  • azure
  • rekognition
  • azure-face
  • bedrock
  • computer-vision
  • privacy
  • photography

Related

Have a project in mind?

Let's see if I can help.

Send a message