Skip to content

Share the clip reader between prep_wake_samples and eval_wake_threshold #82

Description

@jamditis

prep_wake_samples.process() scans the output directory for clips an earlier run left behind, and warns because training and eval score every file in that directory. It reads the directory with its own copy of the logic in eval_wake_threshold._clips().

The copy has already drifted twice:

  • It was written without _clips()'s if not directory.is_dir(): return [] precondition, so a run that wrote no clips crashed on FileNotFoundError (fixed in Disambiguate output stems so same-basename inputs don't overwrite (#7) #81).
  • The two modules keep separate AUDIO_EXTS sets. prep has .aac, .mp4 and .wma; eval does not. So the stale-clip warning can name a file eval would never score, and the two disagree about what counts as a clip.

Both are the same defect: two hand-maintained copies of one rule.

Done when the clip reader and its extension set have one definition that both modules use. The dependency direction that works is eval_wake_threshold importing from prep_wake_samples: prep pulls in only numpy, soundfile and scipy, which eval already gets via pipeline, whereas the reverse would drag openWakeWord into a prep script that does not need a model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions