Datasets:
Formats:
csv
Languages:
English
Size:
1K - 10K
Tags:
arxiv-artifact
reproducibility
research-artifact
computer-science
computer-logic
formal-methods
License:
| from pcmt.edits import apply_edit, perturbation_scores | |
| from pcmt.schema import Window | |
| def test_crop_removes_active_speaker_and_records_perturbation(): | |
| windows = [ | |
| Window("v", 0, 0, 1, audio_atoms=("speech",), visual_atoms=("speaker_visible", "mouth_open", "person_visible"), subtitle_ocr_atoms=()), | |
| ] | |
| edited = apply_edit(windows, "crop") | |
| assert "speaker_visible" not in edited[0].visual_atoms | |
| assert "crop_occlusion" in edited[0].visual_atoms | |
| visual_p, audio_p = perturbation_scores(edited) | |
| assert visual_p == 1.0 | |
| assert audio_p == 0.0 | |
| def test_audio_shift_adds_gap_at_front(): | |
| windows = [ | |
| Window("v", 0, 0, 1, audio_atoms=("speech",), visual_atoms=("speaker_visible", "mouth_open"), subtitle_ocr_atoms=()), | |
| Window("v", 1, 1, 2, audio_atoms=("ambient",), visual_atoms=(), subtitle_ocr_atoms=()), | |
| ] | |
| edited = apply_edit(windows, "audio_shift") | |
| assert "audio_gap" in edited[0].audio_atoms | |
| assert "speech" in edited[1].audio_atoms | |