Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
wctu authored Sep 20, 2018
1 parent dfeae3e commit 06cc312
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![License CC BY-NC-SA 4.0](https://img.shields.io/badge/license-CC4.0-blue.svg)](https://raw.githubusercontent.com/NVIDIA/FastPhotoStyle/master/LICENSE.md)

# Learning Superpixels with Segmentation-Aware Affinity Loss
[Learning Superpixels with Segmentation-Aware Affinity Loss](https://sites.google.com/site/wctu1009/cvpr18_superpixel)

Expand All @@ -6,14 +8,22 @@ IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018

[Project](https://sites.google.com/site/wctu1009/cvpr18_superpixel) | [Paper](http://openaccess.thecvf.com/content_cvpr_2018/html/Tu_Learning_Superpixels_With_CVPR_2018_paper.html)

## License

Copyright (C) 2018 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).

## Getting Started

In this repository, we provide the test code and the model trained on the BSDS500 dataset using the [ERS algorithm](https://github.com/mingyuliutw/EntropyRateSuperpixel) as the superpixel segmenter. We also provide the evaluation scripts used in our experiments.

### Prerequisites

* Hardware: PC with NVIDIA GPU. We have tested the code with GeForce GTX 1080Ti and TitanXP.
* Software: CUDA 9.1, PyTorch 0.4.1, OpenCV 3.4.2

### Data Format

The superpixel labels are all integers, so we saved the superpixel labels as single-channel 16-bit png images.
We can read such png files using OpenCV imread() with extra -1 flag:
```
Expand All @@ -23,12 +33,14 @@ In our experiments, we preprocess all the datasets so that the segmentation grou
In the ```/data``` folder we sample some images from the BSDS500 test set and provide their corresponding ground-truth maps in the 16-bit png format for reference.

### Testing

Go to ```/test``` and run ```test.py```.
The file ```bsds500.pkl``` is the model trained on the BSDS500 dataset with the [ERS algorithm](https://github.com/mingyuliutw/EntropyRateSuperpixel).
The ```ERSModule.so``` is a Python interface of the ERS algorithm.
We modify the original ERS algorithm a bit so that it can take pixel affinities as input. See ```readme_ERS.pdf``` for more details.

### Evaluation

We provide codes for computing the ASA (Achievable Segmentation Accuracy) and the BR (Boundary Recall) scores for superpixel evaluation.
Go to ```/eval``` and run one of the two python scripts for evaluation.
Make sure the input or output folder paths has been specified correctly in the python scripts.
Expand All @@ -38,7 +50,8 @@ The core evaluation functions are written in C++. The file ```EvalSPModule.so```
See ```readme_eval.pdf``` for more details.

## Bibtex
If you find this repository useful in your research, please cite us:

If you find this repository useful in your project, please cite us:
```
@inproceedings{Tu-CVPR-2018,
author = {Tu, Wei-Chih and Liu, Ming-Yu and Jampani, Varun and Sun, Deqing and Chien, Shao-Yi and Yang, Ming-Hsuan and Kautz, Jan},
Expand Down

0 comments on commit 06cc312

Please sign in to comment.