feat(ocr): full OCR pipeline with polygon annotations, training, and guided mode #232

Merged
marcel merged 40 commits from feat/issue-226-227-ocr-pipeline-polygon into main 2026-04-14 10:31:35 +02:00
Showing only changes of commit 94b9c56527 - Show all commits

View File

@@ -465,7 +465,15 @@ async def segtrain_model(
"-N", "10",
]
if os.path.exists(blla_model_path):
cmd += ["-i", blla_model_path]
cmd += ["-i", blla_model_path, "--resize", "both"]
else:
# No pretrained model — train from scratch with reduced height (800px)
# to keep peak RAM under ~200 MB on CPU (default 1800px uses ~500 MB+)
cmd += [
"-s",
"[1,800,0,3 Cr7,7,64,2,2 Gn32 Cr3,3,128,2,2 Gn32 Cr3,3,128 Gn32 "
"Cr3,3,256 Gn32 Cr3,3,256 Gn32 Lbx32 Lby32 Cr1,1,32 Gn32 Lby32 Lbx32]",
]
cmd += xml_files
log.info("Running: %s", " ".join(cmd[:5]) + " ...")