kitzeslab / opensoundscape

Open source, scalable software for the analysis of bioacoustic recordings
http://opensoundscape.org
MIT License
140 stars 16 forks source link

Custom Preprocessor and preprocessing pipeline construction from yaml file #1033

Closed paulpeyret-biophonia closed 1 month ago

paulpeyret-biophonia commented 3 months ago

In OPSO version : 0.10.2 it seems that designing a custom preprocessing/augmentation pipeline requires either to:

In order to get the maximum flexibility over the actions and there parameters, Would it make sense to use a preprocessing_config.yaml file to create a custom preprocessing pipeline? In my mind, that could require to add a CustomPreprocessorclass to the package with a class method .from_yaml() which would be an alternative constructor that provide multiple ways to create different instances of this class. The yaml file would contain a dictionary with each action names (in the desired order of the pipeline) and there associated set of parameters.

Something similar have been done here : https://github.com/musikalkemist/praudio

I see some benefits to this:

Would it make sense? Or is there already a way through flexible Preprocessor customization (I might have missed something)?

sammlapp commented 3 months ago

Hi, we’ve been planning to do this and I actually just started a prototype yesterday :) The challenge/limitstion is that it won’t be able to handle any custom functions defined by the users code. But it will easily save and reload the built in preprocessing functions.

sammlapp commented 3 months ago

initial implementation in this commit https://github.com/kitzeslab/opensoundscape/commit/b729842cea3b2dced46dd599c0bb30b66ec572fb and it will actually support custom functions/classes as long as the user provides them in the code and decorates them so that they are "registered"