• Stars
    star
    917
  • Rank 49,814 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[IJCV 2022] Bridging Composite and Real: Towards End-to-end Deep Image Matting

Bridging Composite and Real: Towards End-to-end Deep Image Matting [IJCV-2022]

This is the official repository of the paper Bridging Composite and Real: Towards End-to-end Deep Image Matting.

Jizhizi Li1โˆ—, Jing Zhang1โˆ—, Stephen J. Maybank2, and Dacheng Tao1
1 The University of Sydney, Sydney, Australia; 2 Birkbeck College, University of London, U.K.
IJCV 2022 (DOI 10.1007/s11263-021-01541-0)

Google Colab Demo | Introduction | GFM | AM-2k | BG-20k | Results Demo | Train and Test | Inference Code | Statement


๐Ÿš€ News

[2021-11-12]: The training code, test code and all the pretrained models are released in this code-base page.

[2021-10-22]: The paper has been accepted by the International Journal of Computer Vision (IJCV)! ๐ŸŽ‰

[2021-09-21]: The datasets AM-2k and BG-20k can now be openly accessed from the links below (both at Google Drive and at Baidu Wangpan) ! Please follow the dataset release agreements to access. Due to some privacy issues, the dataset PM-10k will be published after privacy-preserving from the project Privacy-Preserving Portrait Matting (ACM MM 21). You can refer to this repo for access and updates.

Dataset

Dataset Link
(Google Drive)

Dataset Link
(Baidu Wangpan ็™พๅบฆ็ฝ‘็›˜)

Dataset Release Agreement
AM-2k Link Link (pw: 29r1) Agreement (MIT License)
BG-20k Link Link (pw: dffp) Agreement (MIT License)

[2020-11-17]: Create Google Colab demo to benefit users who want to have a try online.

[2020-11-03]: Publish the inference code and a pretrained model that can be used to test on your own animal images.

[2020-10-27]: Publish a video demo (YouTube | bilibili | Google drive) contains motivation, network, datasets, and test results on an animal video.

Demo on Google Colab

For those who do not have GPUs in their environment or only want to have a simple try online, you can try our Google Colab demo to generate the results for your images easily.

Introduction

This repository contains the code, datasets, models, test results and a video demo for the paper Bridging Composite and Real: Towards End-to-end Deep Image Matting. We propose a novel Glance and Focus Matting network (GFM), which employs a shared encoder and two separate decoders to learn both tasks in a collaborative manner for end-to-end image matting. We also establish a novel Animal Matting dataset (AM-2k) to serve for end-to-end matting task. Furthermore, we investigate the domain gap issue between composition images and natural images systematically, propose a carefully designed composite route RSSN and a large-scale high-resolution background dataset (BG-20k) to serve as better candidates for composition.

We have released the train code, the test code, the datasets, and the pretrained models in this code-base page. We have also prepared a Google Colab demo and inference code for you to test on our pre-trained models on your own sample images. For the datasets AM-2k and BG-20k, please follow the sections AM-2k and BG-20k to access. Besides, we prepare a video demo (YouTube | bilibili) to illustrate the motivation, the network, the datasets, and the test results on an animal video

GFM

The architecture of our proposed end-to-end method GFM is illustrated below. We adopt three kinds of Representation of Semantic and Transition Area (RoSTa) -TT, -FT, -BT within our method.

We trained GFM with four backbones, -(r) (ResNet-34), -(d) (DenseNet-121), -(r2b) (ResNet-34 with 2 extra blocks), and -(r') (ResNet-101). The trained model for each backbone can be downloaded via the link listed below.

Model GFM(d)-TT GFM(r)-TT GFM(r)-FT GFM(r)-BT GFM(r2b)-TT GFM(r')-TT GFM(d)-RIM
Google Drive Link Link Link Link Link Link Link

Baidu Wangpan
(็™พๅบฆ็ฝ‘็›˜)

Link
(pw: l6bd)

Link
(pw: svcv)

Link
(pw: jfli)

Link
(pw: 80k8)

Link
(pw: 34hf)

Link
(pw: 7p8j)

Link
(pw: mrf7)

AM-2k

Our proposed AM-2k contains 2,000 high-resolution natural animal images from 20 categories along with manually labeled alpha mattes. Some examples are shown as below, more can be viewed in the video demo (YouTube | bilibili | Google drive).

AM-2k can be accessed from here (Google Drive | Baidu Wangpan (pw: 29r1)), please make sure that you have read this agreement before accessing the dataset. Please refer to the readme.txt in the dataset folder for more details.

BG-20k

Our proposed BG-20k contains 20,000 high-resolution background images excluded salient objects, which can be used to help generate high quality synthetic data. Some examples are shown as below, more can be viewed in the video demo (YouTube | bilibili | Google drive).

BG-20k can be accessed from here (Google Drive | Baidu Wangpan (pw: dffp)), please make sure that you have read this agreement before accessing the dataset. Please refer to the readme.txt in the dataset folder for more details.

Results Demo

We test GFM on our AM-2k test dataset and show the results as below. More results on AM-2k test set can be found here.

Inference Code - How to Test on Your Images

Here we provide the procedure of testing on sample images by our pretrained models:

  1. Setup environment following this instruction page.

  2. Download pretrained models as shown in section GFM, unzip to the folder models/pretrained/

  3. Save your high-resolution sample images in folder samples/original/.

  4. Setup parameters in scripts/test/test_samples.sh and run it

    chmod +x scripts/*

    ./scripts/test/test_samples.sh

  5. The results of alpha matte and transparent color image will be saved in folder samples/result_alpha/. and samples/result_color/.

We show some sample images from the internet, the predicted alpha mattes, and their transparent results as below. We adopt backbone='r34_2b', rosta=TT, hybrid testing strategy and the pretrained model (Google Drive | Baidu Wangpan (pw: 34hf)) for this case.

Statement

If you are interested in our work, please consider citing the following:

@article{li2022bridging,
  title={Bridging composite and real: towards end-to-end deep image matting},
  author={Li, Jizhizi and Zhang, Jing and Maybank, Stephen J and Tao, Dacheng},
  journal={International Journal of Computer Vision},
  volume={130},
  number={2},
  pages={246--266},
  year={2022},
  publisher={Springer}
}

This project is under the MIT license. For further questions, please contact Jizhizi Li at [email protected].

Relevant Projects

[1] Deep Automatic Natural Image Matting, IJCAI, 2021 | Paper | Github
โ€‚ โ€‚ โ€‚Jizhizi Li, Jing Zhang, and Dacheng Tao

[2] Privacy-Preserving Portrait Matting, ACM MM, 2021 | Paper | Github
โ€‚ โ€‚ โ€‚Jizhizi Liโˆ—, Sihan Maโˆ—, Jing Zhang, and Dacheng Tao

[3] Referring Image Matting, CVPR, 2023 | Paper | Github
โ€‚ โ€‚ โ€‚Jizhizi Li, Jing Zhang, and Dacheng Tao

[4] Rethinking Portrait Matting with Privacy Preserving, IJCV, 2023 | Paper | Github
โ€‚ โ€‚ โ€‚Sihan Maโˆ—, Jizhizi Liโˆ—, Jing Zhang, He Zhang, Dacheng Tao

[5] Deep Image Matting: A Comprehensive Survey, ArXiv, 2023 | Paper | Github
โ€‚ โ€‚ โ€‚Jizhizi Li, Jing Zhang, and Dacheng Tao

More Repositories

1

AIM

[IJCAI'21] Deep Automatic Natural Image Matting
Python
386
star
2

P3M

[ACM MM 2021] Privacy-Preserving Portrait Matting
Python
286
star
3

RIM

[CVPR 2023] Referring Image Matting
201
star
4

matting-survey

Deep Image Matting: A Comprehensive Survey
166
star
5

animal-matting

34
star
6

pytorch-sss

python & pytorch implementation of paper Semantic Soft Segmentation
Jupyter Notebook
21
star
7

cnn-cell-counting

A machine learning model using CNN to count number of cells in a medical image
Python
11
star
8

homography-transformation-python

Performs homography transformation between two images, write in python
Python
6
star
9

all-kinds-crawling-tools

This repository provides all kinds of crawling tools, e.g. image-crawler, paper-crawler
Python
5
star
10

person-detector

A machine learning model built on flask framework, mostly uses openCV to detect person in photo, can be used in single or batch images
Python
4
star
11

Cell_Image_Processing-Cell_Sequence_Tracking

MATLAB
4
star
12

generate-close-view

Generate close view and paste on original image with any ratio, can be used in writing papers or making slides
Python
3
star
13

codebrew2015

Java
2
star
14

files

2
star
15

ml-algorithms

Some common used machine learning algorithms
Python
2
star
16

Approximate-Matching

Python
2
star
17

GOY-similarBrand

a simple nlp algorithm to find similar brand for Good On You app
Python
1
star
18

MyTime

android app for sharing/uploading/editing photos
Java
1
star
19

Online-Folder-Backup

1
star
20

BetterTrip

CSS
1
star
21

Pairwise-Relationship-Prediction

MATLAB
1
star
22

Fashion-Hackday-20171112

code used in fashion-hackday @20171112
Python
1
star
23

CellCounting_CNN

CNN model build to count the cell from microscopy image(Master's Thesis)
Jupyter Notebook
1
star