recipes.cad1.task2.data_preparation.build_scene_metadata module

Module to Generate the metadata for the scenes in the CAD-1 Task-2 challenge.

recipes.cad1.task2.data_preparation.build_scene_metadata.get_random_car_params(min_speed: int = 50, max_speed: int = 120) dict[source]

Returns a dictionary with the parameters for a car noise. These parameters are generated randomly, based on the car speed. The parameters are to be used by the CarNoiseSignalGeneration class

Parameters:
  • min_speed (-) – The minimum speed that can be returned (default 50).

  • max_speed (-) – The maximum speed that can be returned (default 120).

Returns:

A dictionary containing parameters needed by CarNoiseSignalGeneration class.

recipes.cad1.task2.data_preparation.build_scene_metadata.get_random_head_rotation(input_dict: dict) Any[source]

Selects a random head rotation degree.

Parameters:

input_dict (dict) – A dictionary where keys are bird IDs and values are bird data.

Returns:

A random item from the input dictionary.

recipes.cad1.task2.data_preparation.build_scene_metadata.get_random_snr(min_snr, max_snr, round_to=4) float[source]

Function to get a random SNR value.

Parameters:
  • min_snr (float) – The minimum SNR value.

  • max_snr (float) – The maximum SNR value.

  • round_to (int) – The number of decimals to round the SNR value to.

Returns:

A random SNR value.

Return type:

float

recipes.cad1.task2.data_preparation.build_scene_metadata.read_json(path_file) dict[source]

Function the read a json file and return the data as a dictionary or only the keys if `return_keys` is True.

Parameters:

path_file (str) – Path to the json file.

recipes.cad1.task2.data_preparation.build_scene_metadata.run(cfg: DictConfig) None[source]

Main function to generate metadata for the scenes in the CAD-1 Task-2 challenge.

This function relies on a random seed to generate the metadata. The seed is set to 2023 by default and it should always be present. This ensures all participant have access to the same initial scenes. However, participants can augment the number of scenes by adding more seeds in the config file. Note the first seed must always be 2023 and cannot be change.

Parameters:

cfg (DictConfig) – The configuration object.

recipes.cad1.task2.data_preparation.build_scene_metadata.set_seed(seed: int) None[source]

Set the seed for the random number generator.