Commit graph

3 commits

Author SHA1 Message Date
83ad1feaba refactor: move backend into the clipwright package
All checks were successful
CI / backend-tests (pull_request) Successful in 30s
CI / frontend-build (pull_request) Successful in 29s
Restructure the 37 root-level Python modules into a proper package:
  clipwright/{core,api,pipeline,layouts,media,integrations,tools}

- Rewrite every local import (module-level and deferred) to absolute
  clipwright.<group>.<mod> form; no legacy root shims or re-exports.
- Add clipwright/core/paths.py and route fonts/assets/cookies through it.
- Entry points: uvicorn clipwright.api.app:app; jobs run as
  python -m clipwright.pipeline.main; probe as -m ...quality_probe.
- child_env() appends REPO_ROOT to PYTHONPATH so the -m workers work.
- transcribe_backends: sys.modules key now clipwright.media.scene_detection.
- Tooling: root pyproject.toml (pytest pythonpath=[.], ruff), shared
  requirements-test.txt, CI installs it, Docker PYTHONPATH=/app.
- Tests: all imports/fakes/source-scans repointed; new tests/test_package_layout.py
  enforces no root modules, docstring-only __init__, and no legacy imports.
- Docs/comments updated for the new layout.

Backend: 744 passed, 19 skipped. Frontend lint+build green.
2026-10-04 20:40:38 +01:00
juancarlos.cavero
3818ed9dcd fix(panel): a 2x2 grid for three people, not three bands
Three horizontal bands was the obvious shape and it is geometrically wrong.
A 1080x640 band is LANDSCAPE, so filling one from a 1080-tall source needs a
1551px-wide crop; on a 1920 frame holding three people that reaches both
neighbours, and the rendered bands each showed two faces. Clamping the crop to
the space a person owns then produced 328x194, upscaled 3.3x into a blurry
close-up of a nose. Both were rendered and looked at before this changed.

A 2x2 grid has PORTRAIT tiles (540x960), which ask for a tall narrow crop, the
shape a person actually occupies. Three people take three cells and the fourth
holds the wide shot, letterboxed rather than cropped, which doubles as context
for who else is in the room.

The neighbour clamp stays: it is what stops a crop reaching the next person
whenever the tile aspect would otherwise allow it.

Verified on a synthetic wide shot built from three corpus talking heads (the
first attempt at that was wrong too: hstacking three 640x360 tiles and scaling
to 1080 tall stretched every face 3x and the detector found nothing).
2026-07-31 14:24:46 +02:00
juancarlos.cavero
16fdf3695f feat(reframe): panel layout for 3-4 people, and separation by distance
Generalises stacking past two: three 1080x640 bands, or a 2x2 grid of 540x960.
Same criteria as SPLIT (coexistence in the same frame, minimum size,
separation) because the failure modes are the same.

Every tile the same size on purpose: a bigger tile claims that person matters
more, and the layout has no way to know that.

The separation test moves from horizontal gap to distance between centres.
Measured on a real recording: two webcams on the same side of the frame, 18px
apart horizontally and 545px vertically. Judging by horizontal gap alone called
them the same person and threw the scene away.

Added overlap suppression (IoU) before counting heads. It is a guard rather
than a fix for a measured bug: on the corpus no pair of boxes exceeds the
threshold, so today it changes no decision.

NOT VALIDATED against real material: of eight panel downloads three failed and
none of the other five is a wide shot of 3-4 people.
2026-07-31 13:28:46 +02:00