This repository contains the code related to the method SSnnPU+KSPTrack from paper A Positive/Unlabeled Approach for the Segmentation of Medical Sequences using Point-Wise Supervision.
The following instructions have been tested to work on a Ubuntu 20.04 machine.
- Clone this repository and head to the root directory.
- Install PyTorch and pybind11 as build-time dependencies. This is necessary to build the CUDA superpixel pooling extension and the K-shortest paths C++ extension, respectively.
pip install "torch>=1.8" "pybind11>=2.6"
- Install the package. This will install the required run-time dependencies.
pip install .
We make the datasets, manual ground truth annotations and point-wise locations used in our experiments public. Head to https://zenodo.org/record/5007789/files/data.zip?download=1 to download the archive.
We provide a script to run the whole pipeline.
Head to the ksptrack
directory and run:
python run.py --in-path <path/to/DatasetXY> --out-path <path/to/results/DatasetXY> --pi-overspec-ratio 1.4 --cuda --ksp
The paths must be modified according to your use case.
The ksp
flag argument will run the spatio-temporal regularization step.
The pi-overspec-ratio
variable denotes a multiplicative factor applied to the maximum positive-class frequency computed from
the manual ground truth annotations.
It ultimately sets the initial prior (see variable eta
in the paper for details).