src.embeddings.birdnet

Classes

BirdnetEmbedding

BirdNet embedding model class for generating embeddings from audio data using the BirdNET model.

Module Contents

class src.embeddings.birdnet.BirdnetEmbedding(dataset_name: str, clip_duration: float = 3.0, model_path: str | pathlib.Path | None = os.path.join('assets', 'models', 'birdnet', 'V2.4', 'BirdNET_GLOBAL_6K_V2.4_Model'), sampling_rate: int | None = None)

Bases: embeddings.BaseEmbedding

BirdNet embedding model class for generating embeddings from audio data using the BirdNET model.

This class extends the BaseEmbedding class and provides the specific implementation for loading the BirdNet model and processing audio datasets. BirdNet is used for analyzing and extracting features from audio clips, often for tasks such as species identification from bird calls.

Inherited Attributes:

model_pathstr

Path to the pre-trained model used for generating embeddings.

dask_clientdask.distributed.client.Client or None

Optional Dask client for handling distributed task execution.

Methods:

load_model():

Loads the BirdNet-specific model using TensorFlow.

process(dataset_name: str, extension: str = ‘.wav’, sampling_rate: int = 48000):

Processes the audio dataset to generate embeddings using the BirdNet model.

sampling_rate
load_model()

Load the BirdNet-specific model, using a TensorFlow SMLayer for generating embeddings.

process()

Process the dataset using the BirdNet model to generate embeddings.

Parameters:
  • dataset_name – Name of the dataset to process.

  • sampling_rate – The sampling rate for the audio files (default is 48,000).

Returns:

A pandas DataFrame containing the generated embeddings.