tempo_eval.read_reference_annotations

tempo_eval.read_reference_annotations(corpus_name, namespace='tempo', validate=True)[source]

Read annotations for reference datasets.

Parameters
  • corpus_name (str) – corpus name (corresponds to folder name). See list_reference_corpus_names to get a list of valid names.

  • namespace (Union[str, Iterable[str]]) – one or more jam annotation namespace(s), e.g., tempo for tempo annotations (see jams namespaces)

  • validate (bool) – validate jam while reading (validation impacts performance negatively)

Returns

jam annotation objects, organized as nested dicts with version and item ids as keys

Return type

dict[str, dict[str, jams.Annotation]]

Note

By default, validate is True in order to stay safe. But since it affects performance quite a bit, you might want to turn validation off when using this function to keep your sanity.

Example

>>> from tempo_eval import read_reference_annotations, extract_tempo
>>> smc_ground_truth = read_reference_annotations('smc_mirex', validate=False)  # turn validation off for speed
>>> smc_1_0_205 = smc_ground_truth['tempo']['1.0']['SMC_205.jams']  # choose reference version '1.0'
>>> tempo = extract_tempo(smc_1_0_205)
>>> print(tempo)
78.74015748031492

See also

To read estimates, use read_estimate_annotations.