foley.eval.clip_checks#

The per-clip scorers foley.generate can run on each stored clip: one table (#277).

Each ClipCheck is a model that scores one clip on its own (no reference set, no prompt), run in its own interpreter: Audiobox Aesthetics (aesthetics=, foley.eval.aesthetics) and PAM (pam=, foley.eval.pam). generate resolves the ones asked for before it spends anything, then records each verdict in qc[name] and a note, the same way for all of them: a record, never a quarantine, unchecked with a scrubbed reason when it cannot run. A new scorer is a row here plus its keyword on generate (and foley.generate), which hands it to the table.

>>> sorted(clip_checks())
['aesthetics', 'pam']
>>> resolve_clip_scorers({"aesthetics": None, "pam": False})
{}

Functions

clip_checks()

The per-clip scorers, by generate keyword (imported on use: none is loaded unless asked for).

resolve_clip_scorers(options)

{name: scorer} for each option asked for (None and False are not).

Classes

ClipCheck(name, resolve, verdict, note_for, ...)

One per-clip scorer generate can run.

class foley.eval.clip_checks.ClipCheck(name, resolve, verdict, note_for, duplicate_note)[source]#

Bases: object

One per-clip scorer generate can run.

name#

The generate keyword, and the qc key its verdict is stored under.

Type:

str

resolve#

option -> scorer | None; raises for a bad value or a missing interpreter (so before anything is paid for).

Type:

Callable

verdict#

(audio_bytes, *, scorer) -> dict; never raises.

Type:

Callable

note_for#

verdict -> str | None, the candidate note.

Type:

Callable[[dict], Optional[str]]

duplicate_note#

The note when a duplicate’s stored twin already has a verdict.

Type:

str

foley.eval.clip_checks.clip_checks()[source]#

The per-clip scorers, by generate keyword (imported on use: none is loaded unless asked for).

Return type:

dict[str, ClipCheck]

foley.eval.clip_checks.resolve_clip_scorers(options)[source]#

{name: scorer} for each option asked for (None and False are not).

Raises:
Return type:

dict[str, object]