-
Notifications
You must be signed in to change notification settings - Fork 2
Description
When using the code provided in this documentation, but replacing the NullPostprocessor with a BaseHandwrittenPostprocessor, two errors arise due to default augmentations applied by the handwritten postprocessor.
-
Scribbles Augmentation (scribbles.py, Augraphy)
The scribbles augmentation attempts to use random fonts, which causes a file-writing error if the required fonts directory does not exist. I resolved this by manually creating the fonts directory beforehand. -
Ink Generation (inkgenerator.py, Augraphy)
In the generate_noise_clusters function of theInkGeneratorclass, thestd_rangevalues must be explicitly cast tointbefore being passed torandom.randint. Otherwise, a type mismatch error occurs.
I don't know whether these issues should be addressed within this library or reported upstream to Augraphy. Regardless, here’s the code that triggers the errors:
model = BaseHandwrittenModel()
postprocessor = BaseHandwrittenPostprocessor(rng=random.Random(42))
compositor = DefaultCompositor(postprocessor)
renderer = BitmapRenderer()
# Assume `raw` is a string containing MusicXML data
scene = model(data=raw, format=".musicxml")
compositor.run(scene.pages[0].view_box, dpi=120)
renderer.render(final_layer)