feat(apps): add impact-seg-konfai segmentation CLI wrapper - #18
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asegment/eval/uncertainty/pipelinecommand surface without users hand-writing configs or resolving Hugging Face repos manually. Purely additive: a newapps/impact_seg/bundle built on thekonfai_appspublic API introduced earlier in the stack — no core orkonfai-appschanges.What changed
New app bundle —
apps/impact_seg/(excluded from thekonfaiwheel, like the otherapps/*wrappers).impact_seg_konfai/cli.py) — buildsmainviakonfai_apps.cli.build_app_cli:resolve_apppins the app id toVBoussot/ImpactSeg:<model>(IMPACT_SEG_KONFAI_REPO = "VBoussot/ImpactSeg"), so the model is chosen by a single positionalmodelargument (_add_selection); an unknown name is reported at app-resolution time._add_infer_knobsadds--ensemble,--tta, and--mc(allint, default0);resolve_inferreturns theinferkwargs{"ensemble", "ensemble_models": [], "tta", "mc"}.infer_command="segment"renames the inference operation, giving sub-commandssegment/eval/uncertainty/pipeline.pyproject.toml) — distributionimpact-seg-konfaiwithdynamic = ["version", "dependencies"];setuptools_scmrooted at the repo root (root = "../..",tag_regex = "^v(?P<version>.*)$",local_scheme = "no-local-version"); registers theimpact-seg-konfai = impact_seg_konfai.cli:mainconsole script.setup.py) —_release_version()readsVersionfromPKG-INFOwhen building from an sdist, otherwise falls back tosetuptools_scm.get_version, then pinsinstall_requires=["konfai==<v>", "konfai-apps==<v>"]to lock the wrapper to matching core and apps releases.impact_seg_konfai/__init__.py(package docstring),.gitignore, and Apache-2.0LICENSE(SPDX header oncli.py).README.md— documents thebodymodel (11 anatomical labels across CBCT/MR/CT), the four sub-commands and all flags, PyPI/source installation, automatic model download fromVBoussot/ImpactSeg, and a Performance & VRAM section (auto batch-size selection viavram_plan, overridable with--patch-size/--batch-size).Testing
No tests are added or modified —
git diff --name-only pr/modif-core..pr/segtouches onlyapps/impact_seg/*(7 files, +468). The CLI is a declarative wrapper overkonfai_apps.cli.build_app_cli, which already exists on the base branch and is covered by thekonfai-apps/testssuite; the new surface is limited to the callbacks and packaging metadata above.Review notes
pr/modif-core(feat(core): registration primitives + app patch/batch & asset plumbing #17); review only theapps/impact_seg/diff.konfaiorkonfai-appssources change, so there is no regression surface for existing workflows.==<v>pinning ininstall_requiresties each wrapper release strictly to matchingkonfai/konfai-appsversions (intended; worth a sanity check against the tag scheme), andresolve_inferpasses an emptyensemble_models: [], deferring to the bundle'sapp.jsondefaults when--ensemble/--tta/--mcare left at0.