Structure analysis

Segmentation

Dhrupad Bandish Segmentation

Note

REQUIRES: torch

class compiam.structure.segmentation.dhrupad_bandish_segmentation.DhrupadBandishSegmentation(mode='net', fold=0, model_path=None, splits_path=None, annotations_path=None, features_path=None, original_audios_path=None, processed_audios_path=None, download_link=None, download_checksum=None, device=None)[source]

Dhrupad Bandish Segmentation

download_model(model_path=None, force_overwrite=False)[source]

Download pre-trained model.

load_model(model_path)[source]

Loading weights for model, given self.mode and self.fold

Parameters:

model_path – path to model weights

predict_stm(input_data, input_sr=44100, save_output=False, output_path=None)[source]

Predict Dhrupad Bandish Segmentation

Parameters:
  • input_data – path to audio file or numpy array like audio signal.

  • input_sr – sampling rate of the input array of data (if any). This variable is only relevant if the input is an array of data instead of a filepath.

  • save_output – boolean indicating whether the output figure for the estimation is stored.

  • output_path – if the input is an array, and the user wants to save the estimation, the output_path must be provided, path/to/picture.png.

train(verbose=True)[source]

Train the Dhrupad Bandish Segmentation model

Parameters:

verbose – showing details of the model

update_fold(fold)[source]

Update data fold for the training and sampling

Parameters:

fold – new fold to use

update_mode(mode)[source]

Update mode for the training and sampling. Mode is one of net, voc, pakh, indicating the source for s.t.m. estimation. Use the net mode if audio is a mixture signal, else use voc or pakh for clean/source-separated vocals or pakhawaj tracks.

Parameters:

mode – new mode to use