• Stars
    star
    386
  • Rank 111,213 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 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

[IJCAI'21] Deep Automatic Natural Image Matting

Deep Automatic Natural Image Matting [IJCAI-21]

This is the official repository of the paper Deep Automatic Natural Image Matting.

Jizhizi Li, Jing Zhang, and Dacheng Tao

Introduction | Network | AIM-500 | Results | Train and Test | Inference code | Statement


๐Ÿ“† News

[2021-11-17]: Release the code for training and dataset processing in this code-base page.

[2021-10-02]: Publish the network, the inference code and the pretrained models in this code-base page.

[2021-07-16]: Publish the validation dataset AIM-500. Please follow the readme.txt for details.

Dataset

Dataset Link
(Google Drive)

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

Dataset Release Agreement
AIM-500 Link Link (pw: 0l69) Agreement (MIT License)

Introduction

Different from previous methods only focusing on images with salient opaque foregrounds such as humans and animals, in this paper, we investigate the difficulties when extending the automatic matting methods to natural images with salient transparent/meticulous foregrounds or non-salient foregrounds.

To address the problem, we propose a novel end-to-end matting network, which can predict a generalized trimap for any image of the above types as a unified semantic representation. Simultaneously, the learned semantic features guide the matting network to focus on the transition areas via an attention mechanism.

We also construct a test set AIM-500 that contains 500 diverse natural images covering all types along with manually labeled alpha mattes, making it feasible to benchmark the generalization ability of AIM models. Results of the experiments demonstrate that our network trained on available composite matting datasets outperforms existing methods both objectively and subjectively.

Network - AimNet

We propose the methods consist of:

  • Improved Backbone for Matting: an advanced max-pooling version of ResNet-34, serves as the backbone for the matting network, pretrained on ImageNet;

  • Unified Semantic Representation: a type-wise semantic representation to replace the traditional trimaps;

  • Guided Matting Process: an attention based mechanism to guide the matting process by leveraging the learned semantic features from the semantic decoder to focus on extracting details only within transition area.

The backbone pretrained on ImageNet, the model pretrained on DUTS dataset, and the model pretrained on synthetic matting dataset will be released soon.

Model Pretrained Backbone on ImageNet Pretrained Model on DUTS Dataset Pretrained Model on Synthetic Matting Dataset (update)
Google Drive Link Link Link

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

Link
(pw: 2v1t)

Link
(pw: ud73)

Link
(pw: evik)

AIM-500

We propose AIM-500 (Automatic Image Matting-500), the first natural image matting test set, which contains 500 high-resolution real-world natural images from all three types (SO, STM, NS), many categories, and the manually labeled alpha mattes. Some examples and the amount of each category are shown below. The AIM-500 dataset is published now, can be downloaded directly from Google Drive or Baidu Wangpan (pw: 0l69). Please make sure that you have read the agreement and agreed to it.

Portrait Animal Transparent Plant Furniture Toy Fruit
100 200 34 75 45 36 10

Results on AIM-500

We test our network on different types of images in AIM-500 and compare with previous SOTA methods, the results are shown below. The code for testing and evaluating on AIM-500 can be checked in this code-base page.

Inference Code - How to Test on Your Images

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

  1. Setup environment following this instruction page;

  2. Insert the path REPOSITORY_ROOT_PATH in the file core/config.py;

  3. Download the pretrained AimNet model from here (Google Drive|Baidu Wangpan (pw: evik)) and unzip to the folder models/pretrained/;

  4. Save your sample images in folder samples/original/.;

  5. Setup parameters in the file scripts/test_samples.sh and run by:

    chmod +x scripts/test_samples.sh

    scripts/test_samples.sh;

  6. 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 use the pretrained model from section Network with Hybrid (1/2 & 1/4) test strategy.

Statement

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

@inproceedings{ijcai2021-111,
  title     = {Deep Automatic Natural Image Matting},
  author    = {Li, Jizhizi and Zhang, Jing and Tao, Dacheng},
  booktitle = {Proceedings of the Thirtieth International Joint Conference on
               Artificial Intelligence, {IJCAI-21}},
  publisher = {International Joint Conferences on Artificial Intelligence Organization},
  editor    = {Zhi-Hua Zhou},
  pages     = {800--806},
  year      = {2021},
  month     = {8},
  note      = {Main Track}
  doi       = {10.24963/ijcai.2021/111},
  url       = {https://doi.org/10.24963/ijcai.2021/111},
}

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

Relevant Projects

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

[2] Bridging Composite and Real: Towards End-to-end Deep Image Matting, IJCV, 2022 | Paper | Github
โ€‚ โ€‚ โ€‚Jizhizi Liโˆ—, Jing Zhangโˆ—, Stephen J. Maybank, 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

GFM

[IJCV 2022] Bridging Composite and Real: Towards End-to-end Deep Image Matting
Python
917
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