• Stars
    star
    826
  • Rank 55,195 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[CVPR 2020] CascadePSP: Toward Class-Agnostic and Very High-Resolution Segmentation via Global and Local Refinement

CascadePSP: Toward Class-Agnostic and Very High-Resolution Segmentation via Global and Local Refinement

Ho Kei Cheng*, Jihoon Chung*, Yu-Wing Tai, Chi-Keung Tang

[arXiv] [PDF]

[Supplementary Information (Comparisons with DenseCRF included!)]

[Supplementary image results]

gif

Introduction

CascadePSP is a deep learning model for high-resolution segmentation refinement. This repository contains our PyTorch implementation with both training and testing functionalities. We also provide the annotated UHD dataset BIG and the pretrained model.

Here are some refinement results on high-resolution images. teaser

Quick Start

Tested on PyTorch 1.0 -- though higher versions would likely work for inference as well.

Check out this folder. We have built a pip package that can refine an input image with two lines of code.

Install with

pip install segmentation-refinement

Code demo:

import cv2
import time
import matplotlib.pyplot as plt
import segmentation_refinement as refine
image = cv2.imread('test/aeroplane.jpg')
mask = cv2.imread('test/aeroplane.png', cv2.IMREAD_GRAYSCALE)

# model_path can also be specified here
# This step takes some time to load the model
refiner = refine.Refiner(device='cuda:0') # device can also be 'cpu'

# Fast - Global step only.
# Smaller L -> Less memory usage; faster in fast mode.
output = refiner.refine(image, mask, fast=False, L=900) 

# this line to save output
cv2.imwrite('output.png', output)

plt.imshow(output)
plt.show()

Network Overview

Global Step & Local Step

Global Step Local Step
Global Step Local Step

Refinement Module

Refinement Module

Table of Contents

Running:

Downloads:

More Results

Refining the masks of Human 3.6M

Image Original Mask Refined Mask
Image OriginalMask RefinedMask
Image OriginalMask RefinedMask
Image OriginalMask RefinedMask

The first row is the failure case (see neck).

Credit

PSPNet implementation: https://github.com/Lextal/pspnet-pytorch

SyncBN implementation: https://github.com/vacancy/Synchronized-BatchNorm-PyTorch

If you find our work useful in your research, please cite the following:

@inproceedings{cheng2020cascadepsp,
  title={{CascadePSP}: Toward Class-Agnostic and Very High-Resolution Segmentation via Global and Local Refinement},
  author={Cheng, Ho Kei and Chung, Jihoon and Tai, Yu-Wing and Tang, Chi-Keung},
  booktitle={CVPR},
  year={2020}
}

More Repositories

1

XMem

[ECCV 2022] XMem: Long-Term Video Object Segmentation with an Atkinson-Shiffrin Memory Model
Python
1,750
star
2

Tracking-Anything-with-DEVA

[ICCV 2023] Tracking Anything with Decoupled Video Segmentation
Python
1,248
star
3

Cutie

[CVPR 2024 Highlight] Putting the Object Back Into Video Object Segmentation
Python
705
star
4

STCN

[NeurIPS 2021] Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object Segmentation
Python
542
star
5

MiVOS

[CVPR 2021] Modular Interactive Video Object Segmentation: Interaction-to-Mask, Propagation and Difference-Aware Fusion. Semi-supervised VOS as well!
Python
465
star
6

Mask-Propagation

[CVPR 2021] MiVOS - Mask Propagation module. Reproduced STM (and better) with training code 🌟. Semi-supervised video object segmentation evaluation.
Python
128
star
7

Scribble-to-Mask

[CVPR 2021] MiVOS - Scribble to Mask module
Python
87
star
8

vos-benchmark

Fast and general video object segmentation evaluation.
Python
27
star
9

PyTorch-ARCNN

A test script for ARCNN powered by PyTorch.
Python
14
star
10

davis2016-evaluation

Python
8
star
11

nitrous-ema

Fast and simple post-hoc EMA (Karras et al., 2023) for PyTorch with minimal `.item()` calls. ~78% lower overhead than ema_pytorch.
Python
4
star
12

Course-Data-Analyser

A project for COMP2021 which analyse data of courses in HKUST
HTML
3
star
13

CharTrans-GAN

Use GAN to perform style transfer of Chinese characters.
TeX
3
star
14

BlenderVOSRenderer

Python
2
star
15

Single-View-Metrology-Step-By-Step

An implementation of Single View Metrology (Criminisi99) with step-by-step guidance in a Jupyter Notebook.
Jupyter Notebook
1
star
16

Android-Matrix-Calculator

A simple android matrix calculator which supports input of unknowns.
Java
1
star
17

VisualChat-Painter-example

Java
1
star
18

htyc-eitc-student

This is a repo for storing and sharing the resources provided to EITC students in HTYC.
Java
1
star
19

kinetics_to_frames

Convert kinetics datasets (or other video datasets) to frames. Support resizing and temporal sampling for space efficiency.
Python
1
star
20

Markov-Next-Word

A next-word prediction program using Markov chain with n-gram written in Go.
Go
1
star
21

shared-memory-tensor-dataset

This repository provides an example of reading from a single shared memory tensor from multiple processes (e.g., with DDP).
Python
1
star