Skip to main content

MVANet

CI Release Deploy PyPI

This is a fork of the original MVANet, with bug fixes and packaging improvements.

Installation

pip install mvanet

Usage

from PIL import Image
from mvanet.predictor import MVANetPredictor

test_image = Image.open("/path/to/image.png")

predictor = MVANetPredictor()

# Predict the RGBA image
predicted_image = predictor(test_image, output_type="rgba")
predicted_image.save("rgba.png")

# Predict the mask image
predicted_mask = predictor(test_image, output_type="map")
predicted_mask.save("mask.png")

The official repo of the CVPR 2024 paper (Highlight), Multi-view Aggregation Network for Dichotomous Image Segmentation

PWC PWC PWC PWC PWC

Introduction

Dichotomous Image Segmentation (DIS) has recently emerged towards high-precision object segmentation from high-resolution natural images. When designing an effective DIS model, the main challenge is how to balance the semantic dispersion of high-resolution targets in the small receptive field and the loss of high-precision details in the large receptive field. Existing methods rely on tedious multiple encoder-decoder streams and stages to gradually complete the global localization and local refinement.

Human visual system captures regions of interest by observing them from multiple views. Inspired by it, we model DIS as a multi-view object perception problem and provide a parsimonious multi-view aggregation network (MVANet), which unifies the feature fusion of the distant view and close-up view into a single stream with one encoder-decoder structure. Specifically, we split the high-resolution input images from the original view into the distant view images with global information and close-up view images with local details. Thus, they can constitute a set of complementary multi-view low-resolution input patches.

image

Moreover, two efficient transformer-based multi-view complementary localization and refinement modules (MCLM & MCRM) are proposed to jointly capturing the localization and restoring the boundary details of the targets.

image

We achieves state-of-the-art performance in terms of almost all metrics on the DIS benchmark dataset.

image

We have optimized the code and achieved an enhanced FPS performance, reaching 15.2.

image

Here are some of our visual results:

image

I. Requiremets

  • python==3.7
  • torch==1.10.0
  • torchvision==0.11.0
  • mmcv-full==1.3.17
  • mmdet==2.17.0
  • mmengine==0.8.1
  • mmsegmentation==0.19.0
  • numpy
  • ttach
  • einops
  • timm
  • scipy

II. Training

  1. Download the pretrained model at Google Drive.
  2. Then, you can start training by simply run:
python train.py

III. Testing

  1. Update the data path in config file ./utils/config.py (line 4~8)

  2. Replace the existing path with the path to your saved model in ./predict.py (line 14)

    You can also download our trained model at Google Drive.

  3. Start predicting by:

python predict.py
  1. Change the predicted map path in ./test.py (line 17) and start testing:
python test.py

You can get our prediction maps at Google Drive.

To Do List

  • Release our camere-ready paper on arxiv (done)
  • Release our training code (done)
  • Release our model checkpoints (done)
  • Release our prediction maps (done)

Citations

@article{yu2024multi,
  title={Multi-view Aggregation Network for Dichotomous Image Segmentation},
  author={Yu, Qian and Zhao, Xiaoqi and Pang, Youwei and Zhang, Lihe and Lu, Huchuan},
  journal={arXiv preprint arXiv:2404.07445},
  year={2024}
}

Metadata

Release files for mvanet 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mvanet 0.3.0
File Size Uploaded
mvanet-0.3.0.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mvanet 0.3.0
File Interpreter ABI Platform
mvanet-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.1 kB

Release files / mvanet-0.3.0.tar.gz

Download URL mvanet-0.3.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8b05b4f908ef503aa336b57add494ab996c8cd2abb00d75be26a2fcd4d6f29cb
BLAKE2b-256 checksum
How to use checksums
a6fd52824c4a5a68b4ecb0c5044b70b018737801ceca25e418ba9dd30e76fc01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

Release files / mvanet-0.3.0-py3-none-any.whl

Download URL mvanet-0.3.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc38883ad8b11be861b0a63143fc714bf0d3581239ab51fe9887d93700507074
BLAKE2b-256 checksum
How to use checksums
6cf6443e80456531f26346e841a58fbd34b0016f2c8bf07818ffd59b48c4afdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page