Generic backend for interactive feature-based segmentation in python.
To install:
git clone https://github.com/tldr-group/interactive-seg-backend
cd interactive-seg-backend
pip install .
# requires some extra build steps
pip install --no-build-isolation "pydensecrf @ git+https://github.com/lucasb-eyer/pydensecrf.git"For GPU-enabled featurising (recommended), install with:
pip install '.[gpu]'For development (linters, tests), install with
pip install -e '.[lint,test]'To get all the optional dependencies at once:
pip install '.[all]'curl -LsSf https://astral.sh/uv/install.sh | sh
# restart your shelluv sync --extra gpu
uv pip install --no-build-isolation "pydensecrf @ git+https://github.com/lucasb-eyer/pydensecrf.git"uv sync --all-extras
uv pip install --no-build-isolation "pydensecrf @ git+https://github.com/lucasb-eyer/pydensecrf.git"mkdir tmp
python -m cProfile -s tottime interactive_seg_backend/features/multiscale_classical_cpu.py > tmp/bench.txtRequires the pytest package (pip install '.[test]')
mkdir tests/data
curl -o tests/data/feature-stack.tif https://sambasegment.blob.core.windows.net/resources/isb_test_data/feature-stack.tif
pytest -spip uninstall interactive_seg_backend -y
pip install -e . --no-cache-dirIf offline
pip uninstall interactive_seg_backend -y
pip install . --no-cache-dir --no-index-
logging
-
docstrings
-
make typing story more compelling:
- helper typesafe functions?
- pydantic?
- actually make the main functions able to take in tensors or arrays
- or give up and make separate functions where necesarry
- make core vs main distinction make more sense
- make CPU version still work with conditional imports and string quote types
- export everything important from main / init
- pass down things you care about i.e sample weights into train / train and apply
-
improvements: fixed vf, rules (connectivity) ?
-
applying: patched, 3D (+ average), all with memory consideration (caching)