Home

Awesome

CFBI(+): Collaborative Video Object Segmentation by (Multi-scale) Foreground-Background Integration

The official implementation of Collaborative Video Object Segmentation by (Multi-scale) Foreground-Background Integration. [paper] (TPAMI) [paper] (ECCV 2020, Spotlight) [demo (YouTube)][demo (Bilibili)]

For VOS-related applications or research, we also recommend our latest VOS framework, AOT (NeurIPS 2021), whose performance and efficiency are much better than CFBI(+).

Based on some necessary considerations, we only release the inference here. If you want to get the training code of CFBI, please contact us by email: zongxinyang1996@gmail.com. And please inform us of your institution and the purpose of using CFBI in the email. Thank you for your understanding!

Framework:

<div align=center><img src="https://github.com/z-x-yang/CFBI/raw/master/utils/overview.png" width="80%"/></div>

Some video segmentation results:

<div align=center><img src="https://github.com/z-x-yang/CFBI/raw/master/utils/quality.png" width="80%"/></div>

Requirements

1. Python3
2. pytorch >= 1.3.0 and torchvision
3. opencv-python and Pillow

Getting Started

  1. Prepare datasets:
    • Download the validation split of YouTube-VOS 2018, and decompress the file to datasets/YTB/valid. If you want to evaluate CFBI on YouTube-VOS 2019, please download this split instead.
    • Download 480p TrainVal split of DAVIS 2017, and decompress the file to datasets/DAVIS.
  2. Evaluating:
    • YouTube-VOS: Download pretrained CFBI or CFBI+, to pretrain_models, and then run bash ytb_eval.sh for CFBI or bash ytb_eval_cfbip.sh for CFBI+. After the evaluation, the result will be packed into a Zip file, which you need to send to official evaluation server to calculate a score. For 2019 version, use this server instead. The pretrained CFBI has been trained on YouTube-VOS using a larger batch size (16) and learning rate (0.02), which boosts the performance (J&F) to 81.8% on the validation split of YouTube-VOS 2018.
    • DAVIS: Download pretrained CFBI or CFBI+, to pretrain_models, and then run bash davis_eval.sh for CFBI or bash davis_eval_cfbip.sh for CFBI+. After the evaluation, please use official code to calculate a score, which should be 81.9% or 83.0% (J&F).
    • Fast CFBI: To reduce memory usage, we also provide a fast setting in ytb_eval_fast.sh. The fast setting enables using float16 in the matching process of CFBI. Besides, we apply an atrous strategy in the global matching of CFBI for further efficiency (The discussion of atrous matching will be submitted to our Arxiv paper soon). The fast setting will save a large amount of memory and significantly improve the inference speed of CFBI. However, this will only lose very little performance.
    • Another way for saving memory is to increase the number of --global_chunks. This will not affect performance but will make the network speed slightly slower.

Model Zoo

We recorded the inference speed of CFBI by using one NVIDIA Tesla V100 GPU. Besides, we used a multi-object speed instead of a single-object. A large portion of the sequences in VOS datasets contains multiple objects, and CFBI is good at processing multiple objects simultaneously.

F16 denotes using float16 in the matching process. Fast means using both float16 and atrous strategy in the inference stage. MS denotes using a multi-scale and flip strategy during inference (additional evaluation args --ms 1. 1.15 1.3 1.5 --flip).

YouTube-VOS (Eval on Val 2018):

In the inference stage, we restricted the long edge of each frame to be no more than 1040 (1.3 * 800) pixels, which is consistent with the biggest random-scale size (1.3 * 480p) in the training stage and is smaller than the original size of YouTube-VOS (720p).

NameBackboneJ SeenF SeenJ UnseenF UnseenMeanMulti-Obj <br> FPSLink
ResNet101-CFBI+ResNet101-DeepLabV3+81.886.677.185.682.84.03Click
ResNet101-MS-CFBI+ResNet101-DeepLabV3+82.887.577.385.783.30.48 (88.1%↓)The same as above
ResNet101-F16-CFBI+ResNet101-DeepLabV3+81.986.677.185.682.84.93 (22.3%↑)The same as above
ResNet101-Fast-CFBI+ResNet101-DeepLabV3+81.986.677.185.582.85.06 (25.6%↑)The same as above
ResNet101-CFBIResNet101-DeepLabV3+81.986.375.683.481.83.48Click
ResNet101-F16-CFBIResNet101-DeepLabV3+81.986.475.683.381.84.62 (32.8%↑)The same as above
ResNet101-Fast-CFBIResNet101-DeepLabV3+81.986.475.683.181.87.61 (118.7%↑)The same as above
MobileNetV2-CFBIMobileNetV2-DeepLabV3+80.484.774.982.680.63.88Click
MobileNetV2-Fast-CFBIMobileNetV2-DeepLabV3+80.284.674.782.780.69.69 (150.0↑%)The same as above

DAVIS (Eval on Val 2017):

In the inference stage, we ran using the default size of DAVIS (480p).

NameBackboneJ scoreF scoreMeanMulti-Obj <br> FPSLink
ResNet101-CFBI+-DAVISResNet101-DeepLabV3+80.185.983.05.52Click
ResNet101-CFBI-DAVISResNet101-DeepLabV3+79.384.581.95.88Click
ResNet101-F16-CFBI-DAVISResNet101-DeepLabV3+79.284.481.87.38 (25.5%↑)The same as above
ResNet101-Fast-CFBI-DAVISResNet101-DeepLabV3+77.082.779.910.18 (73.1%↑)The same as above
MobileNetV2-CFBI-DAVISMobileNetV2-DeepLabV3+76.580.378.46.94Click
MobileNetV2-Fast-CFBI-DAVISMobileNetV2-DeepLabV3+75.278.977.113.22 (90.5%↑)The same as above

Citing

@inproceedings{yang2020CFBI,
  title={Collaborative video object segmentation by foreground-background integration},
  author={Yang, Zongxin and Wei, Yunchao and Yang, Yi},
  booktitle={European Conference on Computer Vision},
  pages={332--348},
  year={2020},
  organization={Springer}
}
@article{yang2020CFBIP,
  author={Yang, Zongxin and Wei, Yunchao and Yang, Yi},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={Collaborative Video Object Segmentation by Multi-Scale Foreground-Background Integration}, 
  year={2021},
  volume={},
  number={},
  pages={1-1},
  doi={10.1109/TPAMI.2021.3081597}
}