Unsupervised-Segmentation
An implementation of Unsupervised Image Segmentation by Backpropagation - Asako Kanezaki 金崎朝子 (東京大学)ICASSP. 2018.
Faster and more elegant than origin version. Speed up, 30s(origin) --> 5s(modify)
Paper: https://kanezaki.github.io/pytorch-unsupervised-segmentation/ICASSP2018_kanezaki.pdf
Original version Github: https://github.com/kanezaki/pytorch-unsupervised-segmentation
An Interpretation of this algorithm: https://zhuanlan.zhihu.com/p/68528056 (Warning: Simplified Chinese)
Requement
Necessary: Python 3, Torch 0.4
Unnecessary: skimage, opencv-python(cv2)
Getting Started
Try the high performance code written by me.
python3 demo_modify.py
class Args(object): # You can change the input_image_path ↓
input_image_path = 'image/woof.jpg' # image/coral.jpg image/tiger.jpg
Or you want to try the code written by the original author.
python3 demo_origin.py
python3 demo_origin.py --input image/woof.jpg
Run this demo, and press WASDQE on the keyboard to adjust the parameters. The image show in the GUI, and the parameters show in terminal in real time. You could choose Algorithm felz or Algorithm slic by commenting the code.
- W,S --> parameter 1
- A,D --> parameter 2
- Q,E --> parameter 3
python3 demo_pre_seg__felz_slic.py
Preview
The iterative process: Save the result when the iter_number == 1,2,4,8,16,32,64,128.
The different result of Algorithm felz or Algorithm slic with different parameters.
The left picture: compactness = 10000
The right picture: compactness = 1000
The left picture: Algorithm slic
The right picture: Algorithm felz