Skip to content

Commit 23c9006

Browse files
committed
Used the key ideas from Transcoda: Synthetic datasets and better data augmentations
https://arxiv.org/pdf/2605.10835
1 parent 8b5dcf7 commit 23c9006

14 files changed

Lines changed: 1963 additions & 1054 deletions

homr/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import glob
33
import os
44
import sys
5+
import xml.etree.ElementTree as ET
56
from concurrent.futures import Future
67
from dataclasses import dataclass
78
from enum import Enum
@@ -209,7 +210,7 @@ def process_image(
209210

210211
eprint("Writing XML", result_staffs)
211212
xml = generate_xml(xml_generator_args, result_staffs, title)
212-
xml.write(xml_file)
213+
ET.ElementTree(xml).write(xml_file, encoding="unicode", xml_declaration=True)
213214

214215
eprint("Finished parsing " + str(len(result_staffs)) + " staves")
215216
teaser_file = replace_extension(image_path, "_teaser.png")

homr/music_xml_generator.py

Lines changed: 205 additions & 277 deletions
Large diffs are not rendered by default.

poetry.lock

Lines changed: 451 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ pyclean = "^3.5.0"
3535
coverage = "^7.13.4"
3636
augly = "^1.0.0"
3737
editdistance = "^0.8.1"
38+
augraphy = "^8.2.6"
3839
transformers = {extras = ["torch"], version = "^4.53.2"}
3940
cairosvg = "^2.8.2"
41+
verovio = "^6.2.1"
4042
types-requests = "^2.32.4.20260107"
4143
segmentation-models-pytorch = "^0.5.0"
4244
pytorch-lightning = "^2.6.1"
@@ -49,6 +51,7 @@ albumentations = "^2.0.8"
4951
tensorboard = "^2.20.0"
5052
onnxscript = "^0.6.2"
5153
music21 = "^10.3.0"
54+
pyvips = "^3.1.1"
5255
musicdiff = "^5.2"
5356
datasets = "^5.0.0"
5457

@@ -105,7 +108,9 @@ ignore = [
105108
"PLR0912", # the parsing & conversion logic tends to create large functions, if someone has an idea then open a PR please!
106109
"PLR0915", # the parsing & conversion logic tends to create large functions, if someone has an idea then open a PR please!
107110
"C901", # the parsing & conversion logic tends to create large functions , if someone has an idea then open a PR please!
108-
"PLR2004" #
111+
"PLR2004", #
112+
"PLR0911", # the parsing & conversion logic tends to create large functions, if someone has an idea then open a PR please!
113+
109114
]
110115

111116
[tool.ruff.lint.flake8-tidy-imports]

0 commit comments

Comments
 (0)