Skip to content
Snippets Groups Projects
Commit e2a9c33e authored by Stephane Chavin's avatar Stephane Chavin
Browse files

MaJ

parent e3b54f12
Branches
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ To use the scripts with Raven annotation software ([Raven Lite](https://www.rave ...@@ -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 * go into the folder that contains the scripts
* Run get_train_annot.py * Run get_train_annot.py
* Launch training * Launch training following instructions
<br> <br>
...@@ -179,7 +179,7 @@ This script splits data into training, validation, and optionally test sets base ...@@ -179,7 +179,7 @@ This script splits data into training, validation, and optionally test sets base
To run the script, use the following command: To run the script, use the following command:
```bash ```bash
python get_train_val.py.py <path_to_data> <directory> [options] python get_train_val.py <path_to_data> <directory> [options]
``` ```
# Arguments # Arguments
## Positional Arguments ## Positional Arguments
...@@ -220,6 +220,7 @@ python get_train_annot.py <filename_path> <path_to_data> <directory> [options] ...@@ -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. --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. --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. --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> </details>
<br /> <br />
...@@ -278,7 +279,7 @@ python yolov5/train.py --imgsz <IMG_SIZE> --batch <BATCH_SIZE> --epochs <NB_EPOC ...@@ -278,7 +279,7 @@ python yolov5/train.py --imgsz <IMG_SIZE> --batch <BATCH_SIZE> --epochs <NB_EPOC
- Detect on audio files - Detect on audio files
```bash ```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 /> <br />
...@@ -286,7 +287,7 @@ python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <i ...@@ -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 - Detect on audio files without saving the detection images
```bash ```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 /> <br />
...@@ -300,9 +301,10 @@ python detect.py --weights yolov5/runs/train/<EXP_NB>/weights/best.pt --imgsz <i ...@@ -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. --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. --hop: Hop length for each spectrogram for detection. Default is 50% of window = 512.
--sound: Enable sound. Default is False. Action 'store_true'. --sound: Enable sound. Default is False. Action 'store_true'.
--low: Low pass filter value --low: Low pass filter value.
--high: High pass filter --high: High pass filter.
--cmap: Colormap for the Spectrograms --cmap: Colormap for the Spectrograms.
--minimum : If True, vmin will be stft.mean(), else stft.min().
``` ```
<br /> <br />
......
...@@ -183,7 +183,7 @@ if __name__ == '__main__': ...@@ -183,7 +183,7 @@ if __name__ == '__main__':
parser.add_argument('--test', action='store_const', const=1, parser.add_argument('--test', action='store_const', const=1,
help='Split into train/test/val. 1 - Ratio / 2 for test and' help='Split into train/test/val. 1 - Ratio / 2 for test and'
' same for validation', default=None) ' 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) help='If True, vmin will be stft.mean(), else stft.min()', default=True)
args = parser.parse_args() args = parser.parse_args()
......
...@@ -28,3 +28,5 @@ soundfile>=0.11.0 # Sound library ...@@ -28,3 +28,5 @@ soundfile>=0.11.0 # Sound library
p_tqdm==1.4.0 # Parallel tqdm (progress bar) for Python p_tqdm==1.4.0 # Parallel tqdm (progress bar) for Python
albumentations>=1.0.3 # Image augmentation library albumentations>=1.0.3 # Image augmentation library
scikit-learn>=1.2.2 # Machine learning library scikit-learn>=1.2.2 # Machine learning library
xarray>=2024.3.0 # NetCDF interpreter
h5netcdf>=1.3.0 # NetCDF interpreter
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment