From 24cbecf0f1420cdb2739b89c350a05ce9d0d47a4 Mon Sep 17 00:00:00 2001 From: Loann Peurey Date: Mon, 8 Jul 2024 17:08:44 +0200 Subject: [PATCH 1/3] tests for cli automated import --- tests/test_cli.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index f0c4ee02..56238664 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -53,6 +53,22 @@ def test_import_annotations(project): ) assert exit_code == 0 + +def test_import_automated(project): + stdout, stderr, exit_code = cli( + [ + "child-project", + "automated-import", + PATH, + "--set", + "vtc_rttm", + "--format", + "vtc_rttm", + ] + ) + assert exit_code == 0 + + def test_compute_durations(project): stdout, stderr, exit_code = cli( [ From 6d24a9e459c5a35d46c28e85eadd31ed2648a85c Mon Sep 17 00:00:00 2001 From: Loann Peurey Date: Mon, 8 Jul 2024 17:09:05 +0200 Subject: [PATCH 2/3] docs for automated import --- docs/source/annotations.rst | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/source/annotations.rst b/docs/source/annotations.rst index 25d5a693..eb4307be 100644 --- a/docs/source/annotations.rst +++ b/docs/source/annotations.rst @@ -18,7 +18,7 @@ Importation Single annotation importation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Annotations can be imported one by one or in bulk. Annotation +Annotations can be imported one by one, in bulk or through the automated command. Annotation importation does the following : 1. Convert all input annotations from their original format (e.g. rttm, @@ -62,6 +62,24 @@ Use this to do bulk importation of many annotation files. The input dataframe ``/path/to/dataframe.csv`` must have one entry per annotation to import, according to the format specified at :ref:`format-input-annotations`. +Automated importation +^^^^^^^^^^^^^^^^^^^^^ + +The automated method is mostly used for automated annotations. It is made to assume a certain number of parameters on importation, which allows us to perform the usual importations we are doing without additional input. The command will assume the following: +- the annotation files will cover the entirety of the audio they annotate (equivalent to range_onset 0 and range_offset ) +- the annotation files will have timestamps that are not offset compare to the recording (equivalent to time_seek 0) +- the annotation files will be named exactly like the recording they annotate (including the folder they are in) except for the extension, which depends on the format (equivalent to recording_filename = annotation_filename + extension) +- the format used is the same for all the files and needs to be given in the call, it determines the extension for all the annotation files +- the set to import is the same for all files, must be given in the call + +.. clidoc:: + + child-project automated-import . --help + +:: + + # import the vtc set by using the vtc_rttm format, all annotation files will need to be with extension ``.rttm`` + child-project automated-import . --set vtc --format vtc_rttm Rename a set of annotations ~~~~~~~~~~~~~~~~~~~~~~~~~~~ From ee8b8c1c0609db9eb90e776b4a7f5da4d630d201 Mon Sep 17 00:00:00 2001 From: Loann Peurey Date: Mon, 8 Jul 2024 17:12:08 +0200 Subject: [PATCH 3/3] freeze requirements for pillow for matplotlib --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 3f7fc804..c9c8e3cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ numpy==1.26.4; python_version >= '3.10' pandas==1.3.5; python_version <= '3.10' pandas==2.2.1; python_version >= '3.11' panoptes-client==1.6.1 +pillow<10.4.0 # this is constrained as matplotlib versions used fail on pillow > 10.3.0 praat-parselmouth==0.4.3 pyannote.core==5.0.0 pydub==0.25.1