The GitHub repository has an
examples/ folder which contains two Python scripts to show how to apply the methods
in this library on a PyTorch model. The used dataset and neural network is “testnet”, a simple generated segmentation
dataset using the U-Net architecture. See Testnet for more information.
Run the examples¶
- Install interpret-segmentation into a pip virtualenv or anaconda environment
- Clone GitHub repository:
git clone https://github.com/andef4/interpret-segmentation
- Install additional dependencies:
pip install scikit-image requests/
conda install scikit-image requests
The example uses the “testnet” dataset, you can download the dataset and a pretrained model by running the
Alternatively, you can generate and train the dataset yourself with the
The run one of the example scripts:
Both scripts generate PNG visualizations in the
The runtime of the scripts are around 30-60 seconds on a current generation high-end graphics card (GeForce 1080 Ti/RTX 2080).