GithubHelp home page GithubHelp logo

wibrow / bcnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lkeab/bcnet

0.0 1.0 0.0 6.77 MB

Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers [CVPR 2021]

Home Page: https://arxiv.org/abs/2103.12340

License: MIT License

Python 89.95% C++ 3.56% Cuda 6.42% Shell 0.07%

bcnet's Introduction

Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers [BCNet, CVPR 2021]

License: MIT PWC PWC

This is the official pytorch implementation of BCNet built on the open-source detectron2.

Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers
Lei Ke, Yu-Wing Tai, Chi-Keung Tang
CVPR 2021

Highlights

  • BCNet: Two/one-stage (detect-then-segment) instance segmentation with state-of-the-art performance.
  • Novelty: Explicit occlusion modeling with bilayer decouple for the occluder and occludee.
  • Efficacy: Large improvement both the FCOS (anchor-free) and Faster R-CNN (anchor-based) detectors.
  • Simple: Small additional computation burden and easy to use.

Visualization of Occluded Objects

Qualitative instance segmentation results of our BCNet, using ResNet-101-FPN and Faster R-CNN detector. The bottom row visualizes squared heatmap of contour and mask predictions by the two GCN layers for the occluder and occludee in the same ROI region specified by the red bounding box, which also makes the final segmentation result of BCNet more explainable than previous methods.

Qualitative instance segmentation results of our BCNet, using ResNet-101-FPN and FCOS detector.

Results on COCO test-dev

(Check Table 8 of the paper for full results, all methods are trained on COCO train2017)

Detector Backbone Method mAP(mask)
Faster R-CNN ResNet-50 FPN Mask R-CNN (ICCV'17) 34.2
Faster R-CNN ResNet-50 FPN PANet (CVPR'18) 36.6
Faster R-CNN ResNet-50 FPN MS R-CNN (CVPR'19) 35.6
Faster R-CNN ResNet-50 FPN PointRend (CVPR'20) 36.3
Faster R-CNN ResNet-50 FPN BCNet (CVPR'21) 38.4
Faster R-CNN ResNet-101 FPN Mask R-CNN (ICCV'17) 36.1
Faster R-CNN ResNet-101 FPN MS R-CNN (CVPR'19) 38.3
Faster R-CNN ResNet-101 FPN BMask R-CNN (ECCV'20) 37.7
Faster R-CNN ResNet-101 FPN BCNet (CVPR'21) 39.8
FCOS ResNet-101 FPN BlendMask (CVPR'20) 38.4
FCOS ResNet-101 FPN CenterMask (CVPR'20) 38.3
FCOS ResNet-101 FPN SipMask (ECCV'20) 37.8
FCOS ResNet-101 FPN BCNet (CVPR'21) 39.6, Pretrained Model, Submission File

Introduction

Segmenting highly-overlapping objects is challenging, because typically no distinction is made between real object contours and occlusion boundaries. Unlike previous two-stage instance segmentation methods, BCNet models image formation as composition of two overlapping image layers, where the top GCN layer detects the occluding objects (occluder) and the bottom GCN layer infers partially occluded instance (occludee). The explicit modeling of occlusion relationship with bilayer structure naturally decouples the boundaries of both the occluding and occluded instances, and considers the interaction between them during mask regression. We validate the efficacy of bilayer decoupling on both one-stage and two-stage object detectors with different backbones and network layer choices. The network of BCNet is as follows:

A brief comparison of mask head architectures, see our paper for full details.

Step-by-step Installation

conda create -n bcnet python=3.7 -y
source activate bcnet
 
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch
 
# FCOS and coco api and visualization dependencies
pip install ninja yacs cython matplotlib tqdm
pip install opencv-python==4.4.0.40
# Boundary dependency
pip install scikit-image
 
export INSTALL_DIR=$PWD
 
# install pycocotools. Please make sure you have installed cython.
cd $INSTALL_DIR
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install
 
# install BCNet
cd $INSTALL_DIR
git clone https://github.com/lkeab/BCNet.git
cd BCNet/
python3 setup.py build develop
 
unset INSTALL_DIR

Dataset Preparation

Prepare for coco2017 dataset following this instruction. And use our converted mask annotations to replace original annotation file for bilayer decoupling training.

  mkdir -p datasets/coco
  ln -s /path_to_coco_dataset/annotations datasets/coco/annotations
  ln -s /path_to_coco_dataset/train2017 datasets/coco/train2017
  ln -s /path_to_coco_dataset/test2017 datasets/coco/test2017
  ln -s /path_to_coco_dataset/val2017 datasets/coco/val2017

Multi-GPU Training and evaluation on Validation set

bash all.sh

Or

CUDA_VISIBLE_DEVICES=0,1 python3 tools/train_net.py --num-gpus 2 \
	--config-file configs/fcos/fcos_imprv_R_50_FPN.yaml 2>&1 | tee log/train_log.txt

Pretrained Models

FCOS-version download: link

  mkdir pretrained_models
  #And put the downloaded pretrained models in this directory.

Testing on Test-dev

export PYTHONPATH=$PYTHONPATH:`pwd`
CUDA_VISIBLE_DEVICES=0,1 python3 tools/train_net.py --num-gpus 2 \
	--config-file configs/fcos/fcos_imprv_R_101_FPN.yaml \
	--eval-only MODEL.WEIGHTS ./pretrained_models/xxx.pth 2>&1 | tee log/test_log.txt

Visualization

bash visualize.sh

Reference script for producing bilayer mask annotation:

bash process.sh

Citation

If you find BCNet useful in your research or refer to the provided baseline results, please star this repository and consider citing:

@inproceedings{ke2021bcnet,
    author = {Ke, Lei and Tai, Yu-Wing and Tang, Chi-Keung},
    title = {Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers},
    booktitle = {CVPR},
    year = {2021}
}   

Related Links

Media Report (Chinese) by CVMart | Media Report (Chinese) by 52CV | CVer (Chinese)

License

BCNet is released under the MIT license. See LICENSE for additional details. Thanks to the Third Party Libs detectron2.

bcnet's People

Contributors

lkeab avatar zrcheryl avatar

Watchers

 avatar

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.