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 89a18c430e - Show all commits

View File

@@ -366,12 +366,13 @@ async def train_model(
os.makedirs(checkpoint_dir, exist_ok=True) os.makedirs(checkpoint_dir, exist_ok=True)
cmd = [ cmd = [
"ketos", "--workers", "0", "ketos", "--workers", "0", "--device", "cpu", "--threads", "2",
"train", "train",
"-f", "path", "-f", "path",
"-o", checkpoint_dir, "-o", checkpoint_dir,
"-q", "fixed", "-q", "fixed",
"-N", "50", "-N", "10",
"-B", "1",
] ]
if os.path.exists(KRAKEN_MODEL_PATH): if os.path.exists(KRAKEN_MODEL_PATH):
cmd += ["-i", KRAKEN_MODEL_PATH] cmd += ["-i", KRAKEN_MODEL_PATH]
@@ -457,11 +458,11 @@ async def segtrain_model(
os.makedirs(checkpoint_dir, exist_ok=True) os.makedirs(checkpoint_dir, exist_ok=True)
cmd = [ cmd = [
"ketos", "--workers", "0", "ketos", "--workers", "0", "--device", "cpu", "--threads", "2",
"segtrain", "segtrain",
"-o", checkpoint_dir, "-o", checkpoint_dir,
"-q", "fixed", "-q", "fixed",
"-N", "50", "-N", "10",
] ]
if os.path.exists(blla_model_path): if os.path.exists(blla_model_path):
cmd += ["-i", blla_model_path] cmd += ["-i", blla_model_path]