Biowulf High Performance Computing at the NIH
DEXTR-PyTorch: automated image segmentation using extreme points

DEXTR-PyTorch implements a new approach ("Deep Extreme Cut") to image labeling where extreme points in an object (left-most, right-most, top, bottom pixels) are used as input to obtain precise object segmentation for images and videos. This is done by adding an extra channel to the image in the input of a convolutional neural network (CNN), which contains a Gaussian centered in each of the extreme points. The CNN learns to transform this information into a segmentation of an object that matches those extreme points.

References:

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. Sample session:

ssh -Y biowulf.nih.gov
[user@biowulf]$  sinteractive  --gres=gpu:k80:1 --mem=12g
[user@@cn3316 ~]$  module load DEXTR-PyTorch
Download the source code to your current folder:
[user@@cn3316 ~]$  git clone https://github.com/scaelles/DEXTR-PyTorch.git 
[user@@cn3316 ~]$  git clone https://github.com/weiliu89/VOCdevkit.git
Edit DEXTR-PyTorch/mypath.py by replacing '/path/to/PASCAL/VOC2012' with './':
[user@@cn3316 ~]$ sed -i 's#/path/to/PASCAL/VOC2012/#./#g' DEXTR-PyTorch/mypath.py
Download models:
[user@@cn3316 ~]$ wget https://data.vision.ee.ethz.ch/kmaninis/share/DEXTR/Downloads/models/dextr_pascal-sbd.pth
[user@@cn3316 ~]$ wget https://data.vision.ee.ethz.ch/csergi/share/DEXTR/MS_DeepLab_resnet_trained_VOC.pth
[user@@cn3316 ~]$ mv *.pth DEXTR-PyTorch/models
Run a demo (follow instructions on the screen):
[user@@cn3316 ~]$ dpt
Using CPU implementation
Singularity: Invoking an interactive shell within container...

Singularity DEXTR-PyTorch_gpu.sqsh:~> cd DEXTR-PyTorch
Singularity DEXTR-PyTorch_gpu.sqsh:~> python demo.py
Exit the session.
Singularity DEXTR-PyTorch_gpu.sqsh:~> exit
[user@cn3316 ~]$  exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$