Giter Site home page Giter Site logo

pcaa's Introduction

PCAA for Semantic Segmentation

This repository is for the CVPR2022 paper Partial Class Activation Attention for Semantic Segmentation.

Introduction

For the first time, this paper explores modeling pixel relation via Class Activation Map (CAM). Beyond the previous CAM generated from imagelevel classification, we present Partial CAM, which subdivides the task into region-level prediction and achieves better localization performance. We further propose Partial Class Activation Attention (PCAA) that simultaneously utilizes local and global class-level representations for attention calculation. Notably, our method achieves state-of-the-art performance on several challenging benchmarks.

Usage

Requirements

python>=3.6, torch>=1.3, Pillow, opencv-python

Backbones

We use the pre-trained backbones provided by open-mmlab, including resnet50_v1c and resnet101_v1c.

Dataset

Prepare related datasets: Cityscapes and ADE20K. Data paths should be as follows:

.{YOUR_CS_PATH}
├── gtFine
│   ├── train
│   ├── val
├── leftImg8bit
│   ├── train
│   ├── val

.{YOUR_ADE_PATH}
├── annotations
│   ├── training
│   ├── validation
├── images
│   ├── training
│   ├── validation

Train

Multi-GPU training is required. You should have at least 4 GPUs (>= 11G) to train a model on Cityscapes. You will need 8 GPUs to train a model based on ResNet-101 on ADE20K.

E.g. To train a model on Cityscapes, modify DATA_PATH, BACKBONE, RESTORE_PATH, and SAVE_DIR in scripts/train_cs.sh then run:

sh scripts/train_cs.sh

Test

Single-GPU evaluation is supported.

E.g. To evaluate a model on Cityscapes, modify the settings in scripts/evaluate_cs.sh and run:

sh scripts/evaluate_cs.sh

References

This repo is mainly built based on pytorch-segmentation-toolbox, DNL and mmsegmentation. Thanks for their great work!

Citation

If you find our codes useful, please consider to cite with:

@inproceedings{liu2022partial,
  title={Partial Class Activation Attention for Semantic Segmentation},
  author={Liu, Sun-Ao and Xie, Hongtao and Xu, Hai and Zhang, Yongdong and Tian, Qi},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2022}
}

pcaa's People

Contributors

lsa1997 avatar

Stargazers

 avatar Đức Trí avatar  avatar rhh96 avatar  avatar ChengruZhu avatar  avatar automan avatar chenWang avatar Jiaheng Wang avatar Zeng Lingqi avatar Wenting Chen avatar syypretend avatar wy avatar Lixiang avatar WeiLi Jiang avatar  avatar  avatar THD avatar Double_V avatar  avatar  avatar Borui Zhang avatar  avatar  avatar  avatar Shenghsin Tai avatar  avatar Ye Huang avatar 李开宇 avatar 寂寞梧桐 avatar

Watchers

 avatar

Forkers

wahaha116 mrk1992

pcaa's Issues

询问local feats

我想询问一下GCN Class的作用,根据代码,它好像使16个patch的local feats进行交互,此时的local feats已经含有其他patch的信息了,是否还能表示local feats

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.