Giter VIP home page Giter VIP logo

embedmask's Introduction

EmbedMask: Embedding Coupling for One-stage Instance Segmentation

This is repository is for the paper:

EmbedMask: Embedding Coupling for One-stage Instance Segmentation;
Hui Ying, Zhaojin Huang, Shu Liu, Tianjia Shao and Kun Zhou;
arXiv preprint arXiv:1912.01954

The full paper is available at: https://arxiv.org/abs/1912.01954. But some optimizations have been applied to the codes now, beyond the paper.

Installation

This EmbedMask implementation is based on FCOS, which is also based on maskrcnn-benchmark. Therefore the installation is the same. Please check INSTALL.md of FCOS for installation instructions.

Data Preparation

We do training and inference in the COCO dataset. If you want perform training and inference as well, please download the dataset, and put the data in the right place like follows.

mkdir -p datasets/coco
ln -s /path_to_coco_dataset/annotations datasets/coco/annotations
ln -s /path_to_coco_dataset/train2014 datasets/coco/train2014
ln -s /path_to_coco_dataset/test2014 datasets/coco/test2014
ln -s /path_to_coco_dataset/val2014 datasets/coco/val2014

Pretrained Models

The pretrained models can be downloaded from here. And you should place them in the 'models' directory.

Here are the scores of these models on COCO 'test2014' set:

Model AP
R50_1x 34.7
R101_1x 36.4
R101_ms_3x 38.1

Demo

Once you have finished the installation and downloaded the pretrained models, you can run a quick demo by the following instructions which use the settings and from 'embed_mask_R50_1x'.

# assume that you are under the root directory of this project,
mkdir -p demo/ouput
python demo/embed_mask_demo.py \
    --config-file configs/embed_mask/embed_mask_R50_1x.yaml \
    --weights models/embed_mask_R50_1x.pth

Inference

The following inference command line run inference on coco minival split:

python tools/test_net.py \
    --config-file configs/embed_mask/embed_mask_R50_1x.yaml \
    MODEL.WEIGHT models/embed_mask_R50_1x.pth \
    TEST.IMS_PER_BATCH 4

Speed Testing

The following inference command line run speed testing on coco minival split:

python tools/test_net.py \
    --config-file configs/embed_mask/embed_mask_R50_1x.yaml \
    --speed_only \
    MODEL.WEIGHT models/embed_mask_R50_1x.pth \
    TEST.IMS_PER_BATCH 1 \
    MODEL.EMBED_MASK.POSTPROCESS_MASKS True

Training

The following command line will train 'embed_mask_R50_1x' on 4 GPUs with batchsize 16:

python -m torch.distributed.launch \
    --nproc_per_node=4 \
    --master_port=$((RANDOM + 10000)) \
    tools/train_net.py \
    --config-file configs/embed_mask/embed_mask_R50_1x.yaml \
    DATALOADER.NUM_WORKERS 4 \
    SOLVER.IMS_PER_BATCH 16 \
    OUTPUT_DIR training_dir/embed_mask_R50_1x

Citations

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

@misc{ying2019embedmask,
    title={EmbedMask: Embedding Coupling for One-stage Instance Segmentation},
    author={Hui Ying and Zhaojin Huang and Shu Liu and Tianjia Shao and Kun Zhou},
    year={2019},
    eprint={1912.01954},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

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.