This is the official code for our ICCV 2019 paper, "Bayesian Adaptive Superpixel Segmentation" , co-authored by Roy Uziel, Meitar Ronen, and Oren Freifeld.
The original PyTorch-based GPU code (released in 2019) has been deprecated. The current CUDA-based GPU implementation (of the same algorithm from the paper) is much faster, translating usually to a x50 speedup. For example, using an NVIDIA GeForce GTX 1070 graphics card, a typical running time on a 512x512 image is 0.042 seconds.
GPU
CUDA driver (Tested on 11.3+)
OpenCV
$ git clone https://github.com/BGU-CS-VIL/BASS.git
$ cd BASS
$ mkdir build
$ cd build
$ cmake .. && make
$./Sp_demo_for_direc -d ../images
Mean and contour images will be saved at ../result alongside the segmentation map (csv)
-n the desired number of pixels on the side of a superpixel
-i_std std dev for color Gaussians, should be 0.01<= value <=0.05. A smaller value leads to more irregular superpixels
--im_size resizing input images (single number)
--beta beta (Potts) 0 < value < 10
--alpha alpha (Hasting ratio) 0.01< value <100
./Sp_demo_for_direc -d ../images -n 25
./Sp_demo_for_direc -d ../images -n 15
./Sp_demo_for_direc -d ../images/ --im_size 512 -n 20 --alpha 0.1
./Sp_demo_for_direc -d ../images/ --im_size 512 -n 20 --alpha 20
./Sp_demo_for_direc -d ../images/ --i_std 0.03
./Sp_demo_for_direc -d ../images/ --i_std 0.018
This software is released under the MIT License (included with the software). Note, however, that if you are using this code (and/or the results of running it) to support any form of publication (e.g., a book, a journal paper, a conference paper, a patent application, etc.) then we request you will cite our paper:
@inproceedings{Uziel:ICCV:2019:BASS,
title = {Bayesian Adaptive Superpixel Segmentation},
author = {Roy Uziel and Meitar Ronen and Oren Freifeld},
booktitle = {ICCV},
year={2019}
}