Skip to content

feat(curation): technical_quality scorer + curate_for_character/environment facades - #1

Merged
thorwhalen merged 1 commit into
mainfrom
feat/curation-facades
May 21, 2026
Merged

thorwhalen merged 1 commit into
mainfrom
feat/curation-facades

Conversation

@thorwhalen

Copy link
Copy Markdown
Collaborator

Summary

Adds the curation capability the reelee lookbook bridge (reelee #33) needs — opinionated facades for picking the best reference image(s) from a pool.

  • technical_quality scorer — a derived 0..1 composite of blur + exposure + resolution. The non-face counterpart of face_quality: gives top_k a single rankable metric for environment / prop / style pools. Sharpness-dominant, with exposure-clipping and resolution as secondary terms.
  • curate_for_character(source, *, k=1, face_detector="insightface") — opinionated facade over curate() for picking the most usable reference frame of a known character (IP-adapter conditioning, model-sheet seeding). Scores resolution/sharpness/exposure/face-quality, ranks by face_quality. face_detector swaps the real RetinaFace detector for the deterministic mock_face in tests/demos. No-face images sort last; the pool is never filtered to empty.
  • curate_for_environment(source, *, k=1) — same for non-person pools, ranked by technical_quality. Needs no ML dependency.

Test plan

  • tests/test_curators.py — 8 new tests: technical_quality formula (perfect / clipped / missing-blur), both facades rank sharp above soft, k limiting, no-face best-effort fallback. Driven through mock_face so the suite stays offline.
  • Full suite green locally: 124 passed, 2 skipped (was 116).
  • Smoke-tested the real insightface path end-to-end (no crash; CPU, model auto-downloads once).

…onment facades

Add a derived `technical_quality` scorer (blur + exposure + resolution
composite, 0..1) — the non-face counterpart of `face_quality`, giving
`top_k` a single rankable metric for environment/prop/style pools.

Add two opinionated facades over `curate()`:
- `curate_for_character` — picks the most usable reference frame of a
  known character (resolution/sharpness/exposure/face quality), ranked
  by `face_quality`. `face_detector` defaults to real insightface,
  swappable to `mock_face` for tests.
- `curate_for_environment` — same for non-person pools, ranked by
  `technical_quality`; needs no ML dependency.
@thorwhalen
thorwhalen merged commit 2035f0b into main May 21, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the feat/curation-facades branch May 21, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant