README.md

June 24, 2024 · View on GitHub


OV-PARTS: Towards Open-Vocabulary Part Segmentation

Meng WeiXiaoyu YueWenwei ZhangXihui LiuShu KongJiangmiao Pang*
Shanghai AI Laboratory The University of Hong Kong The University of Sydney University of Macau Texas A&M University

🏠 About

OV-PARTS is a benchmark for Open-Vocabulary Part Segmentation by using the capabilities of large-scale Vision-Language Models (VLMs).

  • Benchmark Datasets: Two refined versions of two publicly available datasets:

  • Benchmark Tasks: Three specific tasks which provides insights into the analogical reasoning, open granularity and few-shot adapting abilities of models.

    • Generalized Zero-Shot Part Segmentation: this benchmark task aims to assess the model’s capability to generalize part segmentation from seen objects to related unseen objects.
    • Cross-Dataset Part Segmentation: except for the zero-shot generalization ability, this benchmark task aims to assess the model’s capability to generalize part segmentation across different datasets with varying granularity levels.
    • Few-Shot Part Segmentation: this benchmark task aims to assess the model’s fast adaptation capability.
  • Benchmark Baselines: Baselines based on existing two-stage and one-stage object-level open vocabulary segmentation methods, including ZSseg, CLIPSeg, CATSeg.

🔥 News

We organize the Open Vocabulary Part Segmentation (OV-PARTS) Challenge in the Visual Perception via Learning in an Open World (VPLOW) Workshop. Please check our website!

🛠 Getting Started

Installation

  1. Clone this repository

    git clone https://github.com/OpenRobotLab/OV_PARTS.git
    cd OV_PARTS
    
  2. Create a conda environment with Python3.8+ and install python requirements

    conda create -n ovparts python=3.8
    conda activate ovparts
    pip install -r requirements.txt
    

Data Preparation

After downloading the two benchmark datasets, please extract the files by running the following command and place the extracted folder under the "Datasets" directory.

tar -xzf PascalPart116.tar.gz
tar -xzf ADE20KPart234.tar.gz

The Datasets folder should follow this structure:

Datasets/
├─Pascal-Part-116/
 ├─train_16shot.json
 ├─images/
 ├─train/
 └─val/
 ├─annotations_detectron2_obj/
 ├─train/
 └─val/
 └─annotations_detectron2_part/
   ├─train/
   └─val/
└─ADE20K-Part-234/
  ├─images/
 ├─training/
 ├─validation/
  ├─train_16shot.json
  ├─ade20k_instance_train.json
  ├─ade20k_instance_val.json
  └─annotations_detectron2_part/
    ├─training/
    └─validation/

Create {train/val}_{obj/part}_label_count.json files for Pascal-Part-116.

python baselines/data/datasets/mask_cls_collect.py Datasets/Pascal-Part-116/annotations_detectron2_{obj/part}/{train/val} Datasets/Pascal-Part-116/annotations_detectron2_part/{train/val}_{obj/part}_label_count.json

Training

  1. Training the two-stage baseline ZSseg+.

    Please first download the clip model fintuned with CPTCoOp.

    Then run the training command:

    python train_net.py --num-gpus 8 --config-file configs/${SETTING}/zsseg+_R50_coop_${DATASET}.yaml
    
  2. Training the one-stage baselines CLIPSeg and CATSeg.

    Please first download the pre-trained object models of CLIPSeg and CATSeg and place them under the "pretrain_weights" directory.

    ModelsPre-trained checkpoint
    CLIPSegdownload
    CATSegdownload

    Then run the training command:

    # For CATseg.
    python train_net.py --num-gpus 8 --config-file configs/${SETTING}/catseg_${DATASET}.yaml
    
    # For CLIPseg.
    python train_net.py --num-gpus 8 --config-file configs/${SETTING}/clipseg_${DATASET}.yaml
    

Evaluation

We provide the trained weights for the three baseline models reported in the paper.

ModelsSettingPascal-Part-116 checkpointADE20K-Part-234 checkpoint
ZSSeg+Zero-shotdownloaddownload
CLIPSegZero-shotdownloaddownload
CatSetZero-shotdownloaddownload
CLIPSegFew-shotdownloaddownload
CLIPSegcross-dataset-download

To evaluate the trained models, add --eval-only to the training command.

For example:

  python train_net.py --num-gpus 8 --config-file configs/${SETTING}/catseg_${DATASET}.yaml --eval-only MODEL.WEIGHTS ${WEIGHT_PATH}

📝 Benchmark Results

  • Zero-shot performance of the two-stage and one-stage baselines on Pascal-Part-116

    ModelBackboneFinetuningOracle-ObjPred-Obj
    SeenUnseenHarmonicSeenUnseenHarmonic
    Fully-Supervised
    MaskFormerResNet-50-55.2852.14-53.0747.82-
    Two-Stage Baselines
    ZSsegResNet-50-49.3512.5720.0440.8012.0718.63
    ZSseg+ResNet-50CPTCoOp55.3319.1728.4854.2317.1026.00
    ZSseg+ResNet-50CPTCoCoOp54.4319.0428.2153.3116.0824.71
    ZSseg+ResNet-101cCPTCoOp57.8821.9331.8156.8720.2929.91
    One-Stage Baselines
    CATSegResNet-101
    &ViT-B/16
    -14.8910.2912.1713.657.739.87
    CATSegResNet-101
    &ViT-B/16
    B+D43.9726.1132.7641.6526.0832.07
    CLIPSegViT-B/16-22.3319.7320.9514.3210.5212.13
    CLIPSegViT-B/16VA+L+F+D48.6827.3735.0444.5727.7934.24
  • Zero-shot performance of the two-stage and one-stage baselines on ADE20K-Part-234

    ModelBackboneFinetuningOracle-ObjPred-Obj
    SeenUnseenHarmonicSeenUnseenHarmonic
    Fully-Supervised
    MaskFormerResNet-50-46.2547.86-35.5216.56-
    Two-Stage Baselines
    ZSseg+ResNet-50CPTCoOp43.1927.8433.8521.305.608.87
    ZSseg+ResNet-50CPTCoCoOp39.6725.1530.7819.522.985.17
    ZSseg+ResNet-101cCPTCoOp43.4125.7032.2821.423.335.76
    One-Stage Baselines
    CATSegResNet-101
    &ViT-B/16
    -11.498.569.816.303.794.73
    CATSegResNet-101
    &ViT-B/16
    B+D31.4025.7728.3120.238.2711.74
    CLIPSegViT-B/16-15.2718.0116.535.003.364.02
    CLIPSegViT-B/16VA+L+F+D38.9629.6533.6724.806.249.98
  • Cross-Dataset performance of models trained on the source dataset ADE20K-Part-234 and tested on the target dataset Pascal-Part-116.

    ModelSourceTarget
    Oracle-ObjPred-ObjOracle-ObjPred-Obj
    CATSeg27.9517.2216.0014.72
    CLIPSeg VA+L+F35.0121.7416.1811.70
    CLIPSeg VA+L+F+D37.7621.8719.6913.88

🔗 Citation

If you find our work helpful, please cite:

@inproceedings{wei2023ov,
  title={OV-PARTS: Towards Open-Vocabulary Part Segmentation},
  author={Wei, Meng and Yue, Xiaoyu and Zhang, Wenwei and Kong, Shu and Liu, Xihui and Pang, Jiangmiao},
  booktitle={Thirty-seventh Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
  year={2023}
}

👏 Acknowledgements

We would like to express our gratitude to the open-source projects and their contributors, including ZSSeg, CATSeg and CLIPSeg. Their valuable work has greatly contributed to the development of our codebase.