nusu-github / BiRefNet-Burn

[Alpha] Implement BiRefNet using Burn.

Repository from Github https://github.comnusu-github/BiRefNet-BurnRepository from Github https://github.comnusu-github/BiRefNet-Burn

BiRefNet-Burn

License

The objective of the BiRefNet-Burn project is to adapt the cutting-edge BiRefNet model, which has been developed within the PyTorch framework, for utilisation within the Burn framework.

Note

At the moment, it works with the combination of the BiRefNet Swin v1 backbone and the Burn WebGPU backend.

Table of Contents

Overview

BiRefNet is a cutting-edge model designed for high-resolution dichotomous image segmentation, as detailed in the paper "Bilateral Reference for High-Resolution Dichotomous Image Segmentation" [1]. This project employs the Burn framework, a unified deep learning framework written in Rust, with the objective of reimplementing BiRefNet in order to achieve enhanced performance and efficiency.

Installation

Prerequisites

  • Rust (latest stable version)

Steps

  1. Install Rust from https://www.rust-lang.org/tools/install

  2. Clone the repository:

    git clone https://github.com/nusu-github/BiRefNet-Burn.git
    cd BiRefNet-Burn
  3. Build the project:

    cargo build --release

Usage

To run inference using the Burn-ported BiRefNet model:

cargo run --release -- --help

This will display available options for running inference on your images.

License

This project is dual-licensed under both the MIT and Apache-2.0 licenses. You may choose either license when using this project.

Acknowledgements

  • BiRefNet by ZhengPeng7, licensed under MIT
  • Burn by Tracel.ai

References

[1] Zheng, P., “Bilateral Reference for High-Resolution Dichotomous Image Segmentation”, arXiv e-prints, Art. no. arXiv:2401.03407, 2024. doi:10.48550/arXiv.2401.03407.

[2] Liu, Z., “Swin Transformer: Hierarchical Vision Transformer using Shifted Windows”, arXiv e-prints, Art. no. arXiv:2103.14030, 2021. doi:10.48550/arXiv.2103.14030.


For any questions or support, please open an issue.

About

[Alpha] Implement BiRefNet using Burn.

License:Apache License 2.0


Languages

Language:Rust 100.0%