Skip to content

Commit 7c23b34

Browse files
Default unrecognized edit names to go in the 'wrong direction' column.
1 parent c569be9 commit 7c23b34

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

best_output.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,6 @@
439439
, /Users/gregc/Documents/test/greg_results/gt/472_.kern, /Users/gregc/Documents/test/greg_results/pred/472_.kern, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 454, 99.12663755458516, 0, 0., 4, 0.8733624454148472, 0, 0., 0, 0., 0, 0., 458, 0, 458, 458, 1.0
440440
, /Users/gregc/Documents/test/greg_results/gt/512_.kern, /Users/gregc/Documents/test/greg_results/pred/512_.kern, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 285, 60.8974358974359, 179, 38.24786324786325, 0, 0., 4, 0.8547008547008547, 0, 0., 0, 0., 0, 0., 468, 0, 468, 468, 1.0
441441
, /Users/gregc/Documents/test/greg_results/gt/537_.kern, /Users/gregc/Documents/test/greg_results/pred/537_.kern, 4, 0.6546644844517185, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 301, 49.263502454991816, 302, 49.42716857610475, 0, 0., 1, 0.16366612111292964, 0, 0., 2, 0.32733224222585927, 1, 0.16366612111292964, 305, 306, 611, 611, 1.0
442-
, /Users/gregc/Documents/test/greg_results/gt/dim_cresc.kern, /Users/gregc/Documents/test/greg_results/pred/dim_cresc.kern, 22, 8.30188679245283, 224, 84.52830188679245, 2, 0.7547169811320755, 1, 0.37735849056603776, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 4, 1.509433962264151, 7, 2.641509433962264, 0, 0., 2, 0.7547169811320755, 2, 0.7547169811320755, 1, 0.37735849056603776, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 61, 204, 265, 265, 1.0
443-
Total:, , , 5125, 3.3957038548692737, 99297, 65.79184501013742, 290, 0.19214714495845647, 2602, 1.7240236937307025, 274, 0.18154592316764506, 213, 0.14112876509017663, 961, 0.6367358838106092, 682, 0.45187707883333555, 6, 0.003975458171554272, 80, 0.053006108954056955, 564, 0.37369306812610154, 46, 0.03047851264858275, 0, 0., 219, 0.14510422326173092, 309, 0.20473609583504498, 108, 0.0715582470879769, 0, 0., 131, 0.08679750341226826, 7, 0.004638034533479983, 0, 0., 2, 0.001325152723851424, 2, 0.001325152723851424, 1915, 1.2688337330877384, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 32812, 21.74045558750646, 5197, 3.443409352927925, 0, 0., 45, 0.029815936286657036, 0, 0., 26, 0.01722698541006851, 13, 0.008613492705034255, 120388, 107986, 228374, 150926, 0.660872078257595
442+
, /Users/gregc/Documents/test/greg_results/gt/dim_cresc.kern, /Users/gregc/Documents/test/greg_results/pred/dim_cresc.kern, 22, 8.208955223880597, 224, 83.58208955223881, 2, 0.746268656716418, 1, 0.373134328358209, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 4, 1.492537313432836, 10, 3.7313432835820897, 0, 0., 2, 0.746268656716418, 2, 0.746268656716418, 1, 0.373134328358209, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 64, 204, 268, 268, 1.0
443+
Total:, , , 5125, 3.3956363588177223, 99297, 65.79053727249236, 290, 0.19214332566968575, 2602, 1.7239894254914563, 274, 0.18154231459825482, 213, 0.14112595988842436, 961, 0.6367232274778207, 682, 0.4518680969197437, 6, 0.003975379151786602, 80, 0.05300505535715469, 564, 0.37368564026794054, 46, 0.030477906830363947, 0, 0., 219, 0.14510133904021097, 309, 0.20473202631700999, 108, 0.07155682473215882, 0, 0., 131, 0.0867957781473408, 10, 0.006625631919644336, 0, 0., 2, 0.0013251263839288673, 2, 0.0013251263839288673, 1915, 1.2688085126118904, 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 0, 0., 32812, 21.740023454736995, 5197, 3.4433409086391613, 0, 0., 45, 0.02981534363839951, 0, 0., 26, 0.017226642991075274, 13, 0.008613321495537637, 120391, 107986, 228377, 150929, 0.660876533100969
444444
, gtpath, predpath, bad kern syntax OMR-ED, bad kern syntax % contribution to OMR-NED, wrong note OMR-ED, wrong note % contribution to OMR-NED, wrong note head OMR-ED, wrong note head % contribution to OMR-NED, wrong flag/beam OMR-ED, wrong flag/beam % contribution to OMR-NED, wrong dot OMR-ED, wrong dot % contribution to OMR-NED, wrong tuplet OMR-ED, wrong tuplet % contribution to OMR-NED, wrong accidental OMR-ED, wrong accidental % contribution to OMR-NED, wrong note stem OMR-ED, wrong note stem % contribution to OMR-NED, wrong graceness OMR-ED, wrong graceness % contribution to OMR-NED, wrong tie OMR-ED, wrong tie % contribution to OMR-NED, wrong articulation OMR-ED, wrong articulation % contribution to OMR-NED, wrong ornament OMR-ED, wrong ornament % contribution to OMR-NED, wrong lyric OMR-ED, wrong lyric % contribution to OMR-NED, wrong clef OMR-ED, wrong clef % contribution to OMR-NED, wrong timesig OMR-ED, wrong timesig % contribution to OMR-NED, wrong keysig OMR-ED, wrong keysig % contribution to OMR-NED, wrong tempo OMR-ED, wrong tempo % contribution to OMR-NED, wrong barline OMR-ED, wrong barline % contribution to OMR-NED, wrong direction OMR-ED, wrong direction % contribution to OMR-NED, wrong dynamic OMR-ED, wrong dynamic % contribution to OMR-NED, wrong crescendo OMR-ED, wrong crescendo % contribution to OMR-NED, wrong diminuendo OMR-ED, wrong diminuendo % contribution to OMR-NED, wrong slur OMR-ED, wrong slur % contribution to OMR-NED, wrong ottava OMR-ED, wrong ottava % contribution to OMR-NED, wrong multi-staff arpeggio OMR-ED, wrong multi-staff arpeggio % contribution to OMR-NED, wrong fingered tremolo OMR-ED, wrong fingered tremolo % contribution to OMR-NED, wrong chord symbol OMR-ED, wrong chord symbol % contribution to OMR-NED, wrong ending OMR-ED, wrong ending % contribution to OMR-NED, wrong staff info OMR-ED, wrong staff info % contribution to OMR-NED, wrong system break OMR-ED, wrong system break % contribution to OMR-NED, wrong page break OMR-ED, wrong page break % contribution to OMR-NED, wrong other object OMR-ED, wrong other object % contribution to OMR-NED, entire measure insert/delete OMR-ED, entire measure insert/delete % contribution to OMR-NED, entire staff insert/delete OMR-ED, entire staff insert/delete % contribution to OMR-NED, wrong metadata OMR-ED, wrong metadata % contribution to OMR-NED, wrong staff group OMR-ED, wrong staff group % contribution to OMR-NED, wrong staff group name/abbrev OMR-ED, wrong staff group name/abbrev % contribution to OMR-NED, wrong staff group brace OMR-ED, wrong staff group brace % contribution to OMR-NED, wrong staff group barline OMR-ED, wrong staff group barline % contribution to OMR-NED, gt numsyms, pred numsyms, total numsyms (in both scores), OMR-ED (OMR Edit Distance), OMR-NED (OMR-ED / total numsyms)

musicdiff/visualization.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,16 +3172,16 @@ def get_edit_distances_dict(
31723172

31733173
edit_distances_dict: dict[str, int] = {}
31743174
for op in op_list:
3175-
if op[0] not in Visualization._HEADER_NAME_OF_EDIT_NAME:
3176-
raise MUSICDIFF_MISSING_HEADER_NAME_ERROR(f'"{op[0]}" has no HEADER_NAME')
3177-
name: str = Visualization._HEADER_NAME_OF_EDIT_NAME[op[0]]
3178-
if op[0].startswith('extra'):
3175+
edit_name: str = op[0]
3176+
if edit_name.startswith('extra'):
31793177
extra: AnnExtra | None = op[1] or op[2]
31803178
if extra is not None and extra.kind:
3181-
name = re.sub('extra', extra.kind, op[0])
3182-
if name not in Visualization._HEADER_NAME_OF_EDIT_NAME:
3183-
raise MUSICDIFF_MISSING_HEADER_NAME_ERROR(f'"{name}" has no HEADER_NAME')
3184-
name = Visualization._HEADER_NAME_OF_EDIT_NAME[name]
3179+
edit_name = re.sub('extra', extra.kind, edit_name)
3180+
3181+
if edit_name not in Visualization._HEADER_NAME_OF_EDIT_NAME:
3182+
edit_name = 'directionins' # default to direction
3183+
name: str = Visualization._HEADER_NAME_OF_EDIT_NAME[edit_name]
3184+
31853185
omr_ed: int = op[3]
31863186
if name not in edit_distances_dict:
31873187
edit_distances_dict[name] = omr_ed

0 commit comments

Comments
 (0)