diff --git a/README.md b/README.md index 18b78aa724b726b05380e98f64b001f3d0672b94..a62a85d9e5bb96a6b9ba9d5fe5612b15e36f0ff4 100755 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ To use the scripts with Raven annotation software ([Raven Lite](https://www.rave * go into the folder that contains the scripts * Run get_train_annot.py -* Launch training +* Launch training following instructions <br> @@ -179,7 +179,7 @@ This script splits data into training, validation, and optionally test sets base To run the script, use the following command: ```bash -python get_train_val.py.py <path_to_data> <directory> [options] +python get_train_val.py <path_to_data> <directory> [options] ``` # Arguments ## Positional Arguments @@ -220,6 +220,7 @@ python get_train_annot.py <filename_path> <path_to_data> <directory> [options] --hop (float): Ratio of hop in window (e.g., 50% = 0.5). Default is 0.5. --cpu (int): Number of CPUs to speed up the process. Default is 1. --test (flag): If provided, splits the data into train/test/validation sets with the ratio 1 - Ratio / 2 for test and the same for validation. If not provided, only train and validation splits are created. +--minimum : If True, vmin will be stft.mean(), else stft.min(). ``` </details> <br /> @@ -278,7 +279,7 @@ python yolov5/train.py --imgsz <IMG_SIZE> --batch <BATCH_SIZE> --epochs <NB_EPOC - Detect on audio files ```bash -python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <imgsz> --conf <conf> --source <PATH_TO_FOLDER_THAT_CONTAIN_WAV> --save-txt --sound --rf <RF> --sampleDur <SampleDur> --window <window> --hop <hop> --low <low> --high <high> --cmap <cmap> --save-conf +python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <imgsz> --conf <conf> --source <PATH_TO_FOLDER_THAT_CONTAIN_WAV> --save-txt --sound --rf <RF> --sampleDur <SampleDur> --minimum <True/False --window <window> --hop <hop> --low <low> --high <high> --cmap <cmap> --save-conf ``` <br /> @@ -286,7 +287,7 @@ python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <i - Detect on audio files without saving the detection images ```bash -python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <imgsz> --conf <conf> --source <PATH_TO_FOLDER_THAT_CONTAIN_WAV> --save-txt --sound --rf <RF> --sampleDur <SampleDur> --window <window> --hop <hop> --low <low> --high <high> --cmap <cmap> --save-conf --nosave +python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <imgsz> --conf <conf> --source <PATH_TO_FOLDER_THAT_CONTAIN_WAV> --save-txt --sound --rf <RF> --sampleDur <SampleDur> --minimum <True/False> --window <window> --hop <hop> --low <low> --high <high> --cmap <cmap> --save-conf --nosave ``` <br /> @@ -300,9 +301,10 @@ python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <i --window: Window size for each spectrogram for detection. Default is 1024. --hop: Hop length for each spectrogram for detection. Default is 50% of window = 512. --sound: Enable sound. Default is False. Action 'store_true'. ---low: Low pass filter value ---high: High pass filter ---cmap: Colormap for the Spectrograms +--low: Low pass filter value. +--high: High pass filter. +--cmap: Colormap for the Spectrograms. +--minimum : If True, vmin will be stft.mean(), else stft.min(). ``` <br /> diff --git a/get_train_annot.py b/get_train_annot.py index da729ffbf428ffefcc8ad031ceb1ee01ee24a88b..df57dceef119594ba677778ff5efb1014e85c4e6 100755 --- a/get_train_annot.py +++ b/get_train_annot.py @@ -183,7 +183,7 @@ if __name__ == '__main__': parser.add_argument('--test', action='store_const', const=1, help='Split into train/test/val. 1 - Ratio / 2 for test and' ' same for validation', default=None) - parser.add_argument('--minimum', type=int, + parser.add_argument('--minimum', type=str, help='If True, vmin will be stft.mean(), else stft.min()', default=True) args = parser.parse_args() diff --git a/requirements.txt b/requirements.txt index c8aa5721a7d01f557a46fb65dd065aba100fa25c..b466db91a7ff7c31c1132167f067e5e51e1fa424 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,3 +28,5 @@ soundfile>=0.11.0 # Sound library p_tqdm==1.4.0 # Parallel tqdm (progress bar) for Python albumentations>=1.0.3 # Image augmentation library scikit-learn>=1.2.2 # Machine learning library +xarray>=2024.3.0 # NetCDF interpreter +h5netcdf>=1.3.0 # NetCDF interpreter