CascadePSP
[CVPR 2020] CascadePSP: Toward Class-Agnostic and Very High-Resolution Segmentation via Global and Local Refinement
Install / Use
/learn @hkchengrex/CascadePSPREADME
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
[Supplementary Information (Comparisons with DenseCRF included!)]

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.

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 |
|:-:|:-:|
|
|
|
Refinement Module

Table of Contents
Running:
Downloads:
More Results
Refining the masks of Human 3.6M
| Image | Original Mask | Refined Mask |
|:-:|:-:|:-:|
|
|
|
|
|
|
|
|
|
|
|
|
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}
}
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
last30days-skill
16.5kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
sec-edgar-agentkit
10AI agent toolkit for accessing and analyzing SEC EDGAR filing data. Build intelligent agents with LangChain, MCP-use, Gradio, Dify, and smolagents to analyze financial statements, insider trading, and company filings.
