HOMRDataset
HOMR dataset contains synthetically generated handwritten music and corresponding annotations.
The input images are grayscale, they have arbitrary height and width, and they represent a single stave of music. The annotations are “semantic” (the notes are annotated with their real pitch and duration which depend on current clef and key signature).
A visualization of first 100 training examples is available here.
npfl138.datasets.homr_dataset.HOMRDataset
Source code in npfl138/datasets/homr_dataset.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
MARKS
class-attribute
instance-attribute
MARKS: int = 938
The number of different marks in the dataset.
Element
class-attribute
instance-attribute
The type of a single dataset element.
Dataset
Bases: TFRecordDataset
Source code in npfl138/datasets/homr_dataset.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
__len__
__len__() -> int
Return the number of elements in the dataset.
Source code in npfl138/datasets/homr_dataset.py
45 46 47 |
|
__init__
__init__(decode_on_demand: bool = False) -> None
Load the HOMR dataset, downloading it if necessary.
Source code in npfl138/datasets/homr_dataset.py
61 62 63 64 65 66 67 68 69 70 |
|
EditDistanceMetric
class-attribute
instance-attribute
EditDistanceMetric = EditDistance
The edit distance metric used for evaluation.
evaluate
staticmethod
Evaluate the predictions
against the gold dataset.
Returns:
-
edit_distance
(float
) –The average edit distance of the predictions in percentages.
Source code in npfl138/datasets/homr_dataset.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
evaluate_file
staticmethod
Evaluate the file with predictions against the gold dataset.
Returns:
-
edit_distance
(float
) –The average edit distance of the predictions in percentages.
Source code in npfl138/datasets/homr_dataset.py
99 100 101 102 103 104 105 106 107 108 109 |
|