lifuguan / SOLOv2-mmdet

This project hosts the code for implementing the SOLOv2 algorithms based on the official project(https://github.com/WXinlong/SOLO). Due to the inheritance designation, it enables developers as well as researchers to integrate into our projects more easily and elegantly.
17 stars 1 forks source link
instance-segmentation mmdetection pytorch solov2

SOLOv2 : mmdetection(2.19.0) implementation

This project hosts the code for implementing the SOLOv2 algorithms based on the official project. Due to the inheritance designation, it enables developers as well as researchers to integrate into their projects more easily and elegantly.

该SOLOv2项目是基于官方项目并在 mmdetection(2.19.0) 上实现的。由于采用继承设计,它使得开发人员和研究人员能够更轻松,更优雅地集成到自己的项目中。

SOLOv2: Dynamic and Fast Instance Segmentation,
Xinlong Wang, Rufeng Zhang, Tao Kong, Lei Li, Chunhua Shen
In: Proc. Advances in Neural Information Processing Systems (NeurIPS), 2020
arXiv preprint (arXiv 2003.10152)

Installation

It requires the following OpenMMLab packages:

Usage

Data preparation

Prepare data following MMDetection and MMSegmentation. The data structure looks like below:

data/
├── coco
│   ├── annotations
│   │   ├── panoptic_{train,val}2017.json
│   │   ├── instance_{train,val}2017.json
│   │   ├── panoptic_{train,val}2017/  # panoptic png annotations
│   │   ├── image_info_test-dev2017.json  # for test-dev submissions
│   ├── train2017
│   ├── val2017
│   ├── test2017

Training and testing

You can run training and testing without slurm by directly using mim for instance segmentation like below:

# SOLOv2 training
export CUDA_VISIBLE_DEVICES=1,2,3,4,5,6,7
export PYTHONPATH=$PWD:$PYTHONPATH  
./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM}

Example:
./tools_det/dist_train.sh configs/det/solo/solov2_r50_fpn_coco.py 7

# SOLOv2 inference
./tools/dist_test.sh ${CONFIG_FILE} ${CHECKPOINT_FILE} ${GPU_NUM}  --show --out  ${OUTPUT_FILE} --eval segm

Example:
./tools/dist_test.sh configs/det/solo/solov2_r50_fpn_coco.py work_dirs/solov2_r50_fpn_coco/latest.pth 1 --eval segm

VSCode debugger launch config

{
    "env": {"PYTHONPATH" : "${workspaceRoot}"},
    "name": "knet:debug",
    "type": "python",
    "request": "launch",
    "program": "${workspaceRoot}/tools/train.py",
    "console": "integratedTerminal",
    "justMyCode": false,
    "args": ["configs/det/knet/knet_s3_r50_fpn_1x_ctw1500.py","--gpus", "1"]
},

Model

Model Multi-scale training Testing time / im AP (minival) Link
SOLO_R50_1x No 77ms 32.9 download
SOLO_R50_3x Yes 77ms 35.8 download
SOLO_R101_3x Yes 86ms 37.1 download
Decoupled_SOLO_R50_1x No 85ms 33.9 download
Decoupled_SOLO_R50_3x Yes 85ms 36.4 download
Decoupled_SOLO_R101_3x Yes 92ms 37.9 download
SOLOv2_R50_1x No 54ms 34.8 download
SOLOv2_R50_3x Yes 54ms 37.5 download
SOLOv2_R101_3x Yes 66ms 39.1 download
SOLOv2_R101_DCN_3x Yes 97ms 41.4 download
SOLOv2_X101_DCN_3x Yes 169ms 42.4 download

Contributing to the project

Any pull requests or issues are welcome.

Citations

Please consider citing our papers in your publications if the project helps your research. BibTeX reference is as follows.

@inproceedings{wang2020solo,
  title     =  {{SOLO}: Segmenting Objects by Locations},
  author    =  {Wang, Xinlong and Kong, Tao and Shen, Chunhua and Jiang, Yuning and Li, Lei},
  booktitle =  {Proc. Eur. Conf. Computer Vision (ECCV)},
  year      =  {2020}
}
@article{wang2020solov2,
  title={SOLOv2: Dynamic and Fast Instance Segmentation},
  author={Wang, Xinlong and Zhang, Rufeng and  Kong, Tao and Li, Lei and Shen, Chunhua},
  journal={Proc. Advances in Neural Information Processing Systems (NeurIPS)},
  year={2020}
}

License

For academic use, this project is licensed under the 2-clause BSD License - see the LICENSE file for details. For commercial use, please contact Xinlong Wang and Chunhua Shen.