How aicelen/andromr works
Andromr is an on-device Android optical music recognition app: users scan or open score images, run recognition, and share the resulting MusicXML. The main runtime spans image preparation and staff/symbol analysis, neural-model inference, score parsing, and XML generation. README documents multi-page input, local privacy, LiteRT encoder/segmentation, and an ONNX decoder. The excerpts do not show all UI callbacks or the complete recognition orchestration, so uncertain internal call links are omitted; the documented model roles and paths are represented.
Main entry points: homr/main.py Recognition workflow · main.py Scan and export UI · staff2score.py Staff to score · tr_omr_parser.py Token score parser
Components 18
Android app
- Scan and export UI
main.py - Recognition workflow
homr/main.py
Image analysis
- Image preparation
homr/image_utils.py - Staff analysis
homr/staff_detection.py - Symbol detection
homr/note_detection.py - Staff parsing
homr/staff_parsing.py
Model inference
- Segmentation inference
homr/segmentation/inference_segnet.py - Staff to score
homr/transformer/staff2score.py - Transformer encoder
homr/transformer/encoder_inference.py - Transformer decoder
homr/transformer/decoder_inference.py - Android inference bridge
java/Staff2Score.java - LiteRT model runtime
java/LiteRTModel.java
Score output
- Token score parser
homr/tr_omr_parser.py - Structured score
homr/results.py - MusicXML generation
homr/music_xml_generator.py - XML serialization
homr/xml_generator.py
Other components
- Score user
- Share target
Connections 16
- Score user → Scan and export UI: scans or opens
- Scan and export UI → Recognition workflow: starts recognition
- Recognition workflow → Image preparation: prepares image
- Recognition workflow → Segmentation inference: requests segmentation
- Recognition workflow → Staff analysis: analyzes staffs
- Recognition workflow → Symbol detection: detects symbols
- Recognition workflow → Staff parsing: parses staffs
- Staff to score → Transformer encoder: encodes staff
- Staff to score → Transformer decoder: decodes score
- Android inference bridge → LiteRT model runtime: runs LiteRT
- Recognition workflow → Staff to score: requests score inference
- Recognition workflow → Token score parser: parses tokens
- Token score parser → Structured score: produces score
- Recognition workflow → MusicXML generation: generates MusicXML
- MusicXML generation → XML serialization: serializes output
- Scan and export UI → Share target: shares export