Giter VIP home page Giter VIP logo

ssp's Introduction

Self-Support Few-Shot Semantic Segmentation

Qi Fan, Wenjie Pei, Yu-Wing Tai, Chi-Keung Tang

The codebase contains the official code of our paper Self-Support Few-Shot Semantic Segmentation, ECCV 2022.

中文解读: ECCV 2022 | SSP: 自支持匹配的小样本任务新**

PWC
PWC
PWC
PWC
PWC
PWC

Data preparation

Download

Pretrained model: ResNet-50 | ResNet-101

Dataset: Pascal images and ids | Semantic segmentation annotations

File Organization

You can follow HSNet to prepare the MS COCO and FSS-1000 datasets.

    ../                         # parent directory
    ├── ./SSP                   # current (project) directory
    |   ├── codes               # various codes
    |   └── ./pretrained        # pretrained model directory
    |            ├── resnet50.pth
    |            └── resnet101.pth
    └── Datasets_SSP/
        ├── VOC2012/            # PASCAL VOC2012 devkit
        │   ├── Annotations/
        │   ├── ImageSets/
        │   ├── ...
        │   └── SegmentationClassAug/
        ├── COCO2014/           
        │   ├── annotations/
        │   │   ├── train2014/  # (dir.) training masks (from Google Drive) 
        │   │   ├── val2014/    # (dir.) validation masks (from Google Drive)
        │   │   └── ..some json files..
        │   ├── train2014/
        │   └── val2014/
        └── FSS-1000/           # (dir.) contains 1000 object classes
            ├── abacus/   
            ├── ...
            └── zucchini/

Run the code

You can adapt the scripts of all.sh, test.sh and hsnet_test.sh (for the HSNet evaluation protocol) to train and evaluate your models.

CUDA_VISIBLE_DEVICES=0,1 python -W ignore main.py \
  --dataset pascal --data-root [Your Pascal Path] \
  --backbone resnet50 --fold 0 --shot 1

You may change the backbone from resnet50 to resnet101, change the fold from 0 to 1/2/3, or change the shot from 1 to 5 for other settings.

You can add/remove --refine to enable/disable the self-support refinement.

Performance and Trained Models

Pascal VOC

Method Setting Backbone SSP Refine Fold 0 Fold 1 Fold 2 Fold 3 Mean
Baseline 1-shot ResNet-50 No 54.9 66.5 61.7 48.3 57.9
Baseline 1-shot ResNet-101 No 57.2 68.5 61.3 53.3 60.1
Baseline 5-shot ResNet-50 No 61.6 70.3 70.5 56.4 64.7
Baseline 5-shot ResNet-101 No 64.2 74.0 71.5 61.3 67.8
SSP (Ours) 1-shot ResNet-50 Yes 61.4 67.8 66.5 50.9 61.7
SSP (Ours) 1-shot ResNet-101 Yes 63.2 70.4 68.5 56.3 64.6
SSP (Ours) 5-shot ResNet-50 Yes 67.5 72.3 75.2 62.1 69.3
SSP (Ours) 5-shot ResNet-101 Yes 70.9 77.1 78.9 66.1 73.3

MS COCO

Method Setting Backbone Eval Protocol Fold 0 Fold 1 Fold 2 Fold 3 Mean
SSP (Ours) 1-shot ResNet-50 Ours 46.4 35.2 27.3 25.4 33.6
SSP (Ours) 1-shot ResNet-101 Ours 50.4 39.9 30.6 30.0 37.7
SSP (Ours) 5-shot ResNet-50 Ours 53.9 42.0 36.0 33.7 41.4
SSP (Ours) 5-shot ResNet-101 Ours 57.8 47.0 40.2 39.9 46.2
SSP (Ours) 1-shot ResNet-50 HSNet 35.5 39.6 37.9 36.7 37.4
SSP (Ours) 1-shot ResNet-101 HSNet 39.1 45.1 42.7 41.2 42.0
SSP (Ours) 5-shot ResNet-50 HSNet 40.6 47.0 45.1 43.9 44.1
SSP (Ours) 5-shot ResNet-101 HSNet 47.4 54.5 50.4 49.6 50.2

Acknowledgement

This codebase is built based on MLC's baseline code and we borrow HSNet's evaluation protocol for the MS COCO dataset. We thank MLC and other FSS works for their great contributions.

Other related repos

Few-shot image/video object detection: FewX

Other related papers

@inproceedings{fan2021fsvod,
  title={Few-Shot Video Object Detection},
  author={Fan, Qi and Tang, Chi-Keung and Tai, Yu-Wing},
  booktitle={ECCV},
  year={2022}
}
@inproceedings{fan2020cpmask,
  title={Commonality-Parsing Network across Shape and Appearance for Partially Supervised Instance Segmentation},
  author={Fan, Qi and Ke, Lei and Pei, Wenjie and Tang, Chi-Keung and Tai, Yu-Wing},
  booktitle={ECCV},
  year={2020}
}
@inproceedings{fan2020fsod,
  title={Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector},
  author={Fan, Qi and Zhuo, Wei and Tang, Chi-Keung and Tai, Yu-Wing},
  booktitle={CVPR},
  year={2020}
}

Citation

@inproceedings{fan2022ssp,
  title={Self-Support Few-Shot Semantic Segmentation},
  author={Fan, Qi and Pei, Wenjie and Tai, Yu-Wing and Tang, Chi-Keung},
  journal={ECCV},
  year={2022}
}

ssp's People

Contributors

fanq15 avatar

Stargazers

 avatar  avatar JiangLulu avatar  avatar Programmer_LonelyPlanet avatar sfpeng avatar  avatar gaunhaiye. avatar Zhonghao Yan avatar Donna Davis avatar Sheldon avatar hekun avatar  avatar Gustavo Martins avatar  avatar  avatar Nastu Ho avatar  avatar  avatar zhuoling avatar  avatar Roger Q. avatar Jiawei Li avatar  avatar Bo_li avatar RYH avatar adisaljusi (アディス) avatar jwhao avatar Hayden P avatar  avatar BigDream avatar  avatar Seonghyeon Moon avatar Tatsuya Ishihara avatar Min avatar  avatar Myoung avatar  avatar  avatar  avatar Wenzheng Liu avatar Rohan Sikand avatar  avatar  avatar  avatar Qiang Hu avatar BTZ-176 avatar Yucheng Han avatar Rasyid Ridha avatar yunkai avatar 黎健钊 avatar dianwenmei avatar Jinx avatar  avatar  avatar  avatar zhangshengsen avatar  avatar Fanteng Meng avatar Iris avatar  avatar  avatar  avatar  avatar  avatar  avatar Chino avatar  avatar Yuri Brigance avatar zhangjunkang avatar  avatar  avatar Ayush Dabra avatar Ernestina avatar  avatar  avatar Lucas avatar  avatar An-zhi WANG avatar 爱可可-爱生活 avatar Jian Ding avatar Jiaming Han avatar  avatar Lihe Yang avatar

Watchers

Tatsuya Ishihara avatar  avatar

ssp's Issues

How to begin training in COCO2014 dataset?

Thanks for your perfect work!
The problem likes the title, I want to know how to begin training the coco2014 dataset.
I found the code "fewshot.py" is customized for the PASCAL dataset

Support for FSS dataset

The paper reports numbers on the FSS dataset, but the codebase doesn't seem to implement the routine for that. Is there any plan to release the training code for FSS?

A slight difference about Pq* in code and paper.

Thanks for your great work!
When I reappearance your code, I have a question about the variable: Pq*.
I found that the Pq * is a slightly diffenent with your paper.
In your paper, Pq* = alpha1 * Ps + alpha2 * Pq, and the alpha1=alpha2=0.5. However, in the code "SSP_matching.py line67", BP_1 = SSBP_1 * 0.3 + ASBP_1 * 0.7.
So, I think that BP_1 should be BP_1 = BP * 0.5 + ASBP_1 * 0.5.
Wish your reply!

关于SSP后续优化的问题?

您好,我是今年刚做小样本分割的小白,看了您的论文觉得SSP模型结构非常简单同时精度很高,其**就是根据预测的查询结果作为支持支持进行相似度预测,那您觉得后续可以在哪方面进行优化呢?您觉得去获得一个更好的预测结果作为支持原型这个方向是有意义的吗?那是不是直接将目前精度很高的几个模型后接咱SSP的**就可以获得更高的精度呢?

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.