Skip to content

feat(apps): add impact-seg-konfai segmentation CLI wrapper - #18

Merged
vboussot merged 1 commit into
pr/modif-corefrom
pr/seg
Jul 3, 2026
Merged

feat(apps): add impact-seg-konfai segmentation CLI wrapper#18
vboussot merged 1 commit into
pr/modif-corefrom
pr/seg

Conversation

@vboussot

@vboussot vboussot commented Jul 3, 2026

Copy link
Copy Markdown
Member

📚 Stacked on #17 (pr/modif-core). The diff is against pr/modif-core.

Summary

Adds impact-seg-konfai, a thin, pip-installable CLI wrapper that runs the published IMPACT-Seg models through KonfAI Apps. These are 2.5D residual-encoder U-Nets that segment CBCT, MR, and CT into a single consistent label space; the bundle gives them a segment / eval / uncertainty / pipeline command surface without users hand-writing configs or resolving Hugging Face repos manually. Purely additive: a new apps/impact_seg/ bundle built on the konfai_apps public API introduced earlier in the stack — no core or konfai-apps changes.

What changed

New app bundle — apps/impact_seg/ (excluded from the konfai wheel, like the other apps/* wrappers).

  • CLI (impact_seg_konfai/cli.py) — builds main via konfai_apps.cli.build_app_cli:
    • resolve_app pins the app id to VBoussot/ImpactSeg:<model> (IMPACT_SEG_KONFAI_REPO = "VBoussot/ImpactSeg"), so the model is chosen by a single positional model argument (_add_selection); an unknown name is reported at app-resolution time.
    • _add_infer_knobs adds --ensemble, --tta, and --mc (all int, default 0); resolve_infer returns the infer kwargs {"ensemble", "ensemble_models": [], "tta", "mc"}.
    • infer_command="segment" renames the inference operation, giving sub-commands segment / eval / uncertainty / pipeline.
  • Packaging (pyproject.toml) — distribution impact-seg-konfai with dynamic = ["version", "dependencies"]; setuptools_scm rooted at the repo root (root = "../..", tag_regex = "^v(?P<version>.*)$", local_scheme = "no-local-version"); registers the impact-seg-konfai = impact_seg_konfai.cli:main console script.
  • Version/deps resolution (setup.py)_release_version() reads Version from PKG-INFO when building from an sdist, otherwise falls back to setuptools_scm.get_version, then pins install_requires=["konfai==<v>", "konfai-apps==<v>"] to lock the wrapper to matching core and apps releases.
  • Housekeepingimpact_seg_konfai/__init__.py (package docstring), .gitignore, and Apache-2.0 LICENSE (SPDX header on cli.py).
  • README.md — documents the body model (11 anatomical labels across CBCT/MR/CT), the four sub-commands and all flags, PyPI/source installation, automatic model download from VBoussot/ImpactSeg, and a Performance & VRAM section (auto batch-size selection via vram_plan, overridable with --patch-size / --batch-size).

Testing

No tests are added or modified — git diff --name-only pr/modif-core..pr/seg touches only apps/impact_seg/* (7 files, +468). The CLI is a declarative wrapper over konfai_apps.cli.build_app_cli, which already exists on the base branch and is covered by the konfai-apps/tests suite; the new surface is limited to the callbacks and packaging metadata above.

Review notes

  • Stacked PR — base is pr/modif-core (feat(core): registration primitives + app patch/batch & asset plumbing #17); review only the apps/impact_seg/ diff.
  • Risk — additive only; no konfai or konfai-apps sources change, so there is no regression surface for existing workflows.
  • Points to verify — the ==<v> pinning in install_requires ties each wrapper release strictly to matching konfai / konfai-apps versions (intended; worth a sanity check against the tag scheme), and resolve_infer passes an empty ensemble_models: [], deferring to the bundle's app.json defaults when --ensemble / --tta / --mc are left at 0.

@vboussot vboussot changed the title feat(apps): add impact-seg-konfai (multimodal body segmentation) feat(apps): add impact-seg-konfai segmentation CLI wrapper Jul 3, 2026
@vboussot
vboussot merged commit 4716765 into pr/modif-core Jul 3, 2026
55 checks passed
@vboussot
vboussot deleted the pr/seg branch July 3, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant