PolySnake
PolySnake copied to clipboard
The official code for “Recurrent Generic Contour-based Instance Segmentation with Progressive Learning”, TCSVT, 2024.
PolySnake
🔥 Good news! Our work has been accepted by IEEE Transactions on Circuits and Systems for Video Technology (TCSVT), 2024.
This is a PyTorch/GPU re-implementation of the paper Recurrent Generic Contour-based Instance Segmentation with Progressive Learning

Results on Instance Segmentation

Results on Scene Text Detection
Results on Lane Detection
Any questions or discussions are welcomed!
Installation
Please see INSTALL.md.
Testing
Testing on Cityscapes
- Download the pretrained model from Google Drive or Baidu Cloud, and put it to
$ROOT/data/model/rcnn_snake/cityscapes/. - Test:
# use coco evaluator python run.py --type evaluate --cfg_file configs/city_snake.yaml # use the cityscapes official evaluator python run.py --type evaluate --cfg_file configs/city_snake.yaml test.dataset CityscapesVal - Speed:
python run.py --type network --cfg_file configs/city_snake.yaml
Testing on Kins
- Download the pretrained model from Google Drive or Baidu Cloud, and put it to
$ROOT/data/model/snake/kins/. - Test:
python run.py --type evaluate --cfg_file configs/kins_snake.yaml test.dataset KinsVal - Speed:
python run.py --type network --cfg_file configs/kins_snake.yaml test.dataset KinsVal
Testing on Sbd
- Download the pretrained model from Google Drive or Baidu Cloud, and put it to
$ROOT/data/model/snake/sbd/. - Test:
python run.py --type evaluate --cfg_file configs/sbd_snake.yaml test.dataset SbdVal - Speed:
python run.py --type network --cfg_file configs/sbd_snake.yaml test.dataset SbdVal
Testing on COCO
- Download the pretrained model from Google Drive or Baidu Cloud, and put it to
$ROOT/data/model/snake/coco/. - Test:
python run.py --type evaluate --cfg_file configs/coco_snake.yaml test.dataset CocoVal - Speed:
python run.py --type network --cfg_file configs/coco_snake.yaml test.dataset CocoVal
Testing on ADE20K
- Download the pretrained model from Google Drive, and put it to
$ROOT/data/model/snake/ade20k/. - Test:
python run.py --type evaluate --cfg_file configs/ade20k.yaml test.dataset ade20kVal - Speed:
python run.py --type network --cfg_file configs/ade20k.yaml test.dataset ade20kVal
Demo
We support demo for image and image folder using python run.py --type demo --cfg_file /path/to/yaml_file demo_path /path/to/image ct_score 0.3.
For example:
python run.py --type demo --cfg_file configs/sbd_snake.yaml demo_path demo_images ct_score 0.3
# or
python run.py --type demo --cfg_file configs/city_snake.yaml demo_path demo_images/munster_000048_000019_leftImg8bit.png ct_score 0.3
If setup correctly, the output will be saved at $ROOT/demo_out/ and look like

Training
The training parameters can be found in project_structure.md.
Training on Cityscapes
python train_net.py --cfg_file configs/city_snake.yaml model rcnn_snake det_model rcnn_det
Training on Kins
python train_net.py --cfg_file configs/kins_snake.yaml model kins_snake
Training on Sbd
python train_net.py --cfg_file configs/sbd_snake.yaml model sbd_snake
Training on COCO
python train_net.py --cfg_file configs/coco_snake.yaml model coco_snake
Training on ADE20K
python train_net.py --cfg_file configs/ade20k.yaml model ade20k_snake
Citation
If you find this code useful for your research, please use the following BibTeX entry.
@article{feng2024recurrent,
title={Recurrent generic contour-based instance segmentation with progressive learning},
author={Feng, Hao and Zhou, Keyi and Zhou, Wengang and Yin, Yufei and Deng, Jiajun and Sun, Qi and Li, Houqiang},
journal={IEEE Transactions on Circuits and Systems for Video Technology},
year={2024}
}
Acknowledgement
Our work benefits a lot from DeepSnake and E2EC. Thanks for their wonderful works.