remove empty measure in svg#113
Conversation
|
Looks like you need to make the formatter happy (make format). After that changes look good. So feel free to merge it! And thanks. |
|
@liebharc Hi, I have finished a full training with and without the patch. Both models show SER at 6% on smoke test. Do you mind running a system level test? I'll send you the models via email later. And now, since benchmark is available, I wonder if we also need to also do this before merging major changes. |
Hi, we also had to email them so likely no reason to worry yet. As they say in their note: "As sometimes 🤗 is not emailing me when someone requests access. If you are interested, please reach out via email.". @aicelen , do you remember the email address you used? |
Yes I'm wondering about that too. I started running polish scores with musicdiff, although that might not be perfect. It is dominated by beam/flag errors as homr simply not making that difference. So in general it would make sense to use polish scores as reference benchmark more in the future, but we would first need to figure out how. Perhaps we should stick to our own parsers as metric? That can cause issues if there is a code update, but a) that can also happen with musicdiff and b) we had the same issue with my testset in the past and the simple solution is to just make a note explaining that in Training.md. I would likely still run my small test set as it's real world images taken by people. If we ever get enough support then we could create a dataset in which people print out reference music which isn't restricted by copy right and use that. |
Oh, I get it, then I'll email them |
|
I'd suggest using our own parsers, instead of musicdiff. I think this depends on my goal:
|
Sure, code and dataset changes overtime, making it hard to compare the current result with the one earlier. I personally think that's OK (or acceptable). It's very hard to keep backward compatibility. |
|
This is the mail address I wrote to: jcmartinez.sevilla@ua.es |
OK, Thanks! |
|
Test result looks good, so I'll merge it. Thanks @liebharc for helping with validation! |
|
How does the newly trained model compare to model 396? If it is better, could you upload it (and the pytorch weights)? |
They performed nealy the same
Yes, of course. But I havn't figured out how to upload model. I'll look into it tomorrow |
|
Hi @weixlu , just wanted to check: Did you hear ever back regarding your SMB access? I rarely use the dataset myself, so it might not be crucial, but still wanted to know how things went. |
I have got the access! In fact, I run the benchmark and see it takes quite some time, So I plan to do some optimization next week. |

Describe the bug
When running
convert_lieder.py, the following message can often be seen:This happens because, when counting the number of measures in

.svgfiles, empty measures cannot be correctly detected and skipped. For example, see the image below, this barline should be removed:#102 partially fixed this issue, but the approach is not robust enough. For example, the barline below would also be incorrectly removed.
How to fix
This PR detects whether a measure contains any notes, and then decides whether to remove.
Specifically:
In
get_position_information_from_svg(), in addition to collecting barline, this PR adds_parse_note_position()to collect the positions of notes (including rests). It then calls the newly added_remove_empty_measures()to remove empty measures.The way empty measures are removed is as follows: first, staves are matched by system. Then, for each system, the newly added
_staff_has_content_between()is called to check whether any note falls within any staff. If not, the corresponding barline is removed.Tests
I mainly verified by checking the logs of
convert_lieder.py, with particular attention to messages like:The results are:
(Finally the patch is done (😌relieved face), we do not need to merge this patch immediately. Later, I will train the model once with this patch and once without it, and compare the results.)