Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
title: ZIM demo
|
| 3 |
emoji: π
|
| 4 |
colorFrom: yellow
|
|
@@ -11,4 +12,65 @@ python_version: 3.10.12
|
|
| 11 |
short_description: 'ZIM: Zero-Shot Image Matting for Anything demo'
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
title: ZIM demo
|
| 4 |
emoji: π
|
| 5 |
colorFrom: yellow
|
|
|
|
| 12 |
short_description: 'ZIM: Zero-Shot Image Matting for Anything demo'
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# ZIM: Zero-Shot Image Matting for Anything
|
| 16 |
+
|
| 17 |
+
## Introduction
|
| 18 |
+
|
| 19 |
+
π Introducing ZIM: Zero-Shot Image Matting β A Step Beyond SAM! π
|
| 20 |
+
|
| 21 |
+
While SAM (Segment Anything Model) has redefined zero-shot segmentation with broad applications across multiple fields, it often falls short in delivering high-precision, fine-grained masks. Thatβs where ZIM comes in.
|
| 22 |
+
|
| 23 |
+
π What is ZIM? π
|
| 24 |
+
|
| 25 |
+
ZIM (Zero-Shot Image Matting) is a groundbreaking model developed to set a new standard in precision matting while maintaining strong zero-shot capabilities. Like SAM, ZIM can generalize across diverse datasets and objects in a zero-shot paradigm. But ZIM goes beyond, delivering highly accurate, fine-grained masks that capture intricate details.
|
| 26 |
+
|
| 27 |
+
π Get Started with ZIM π
|
| 28 |
+
|
| 29 |
+
Ready to elevate your AI projects with unmatched matting quality? Access ZIM on our [project page](https://naver-ai.github.io/ZIM/), [Arxiv](https://huggingface.co/papers/2411.00626), and [Github](https://github.com/naver-ai/ZIM).
|
| 30 |
+
|
| 31 |
+
## Installation
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
pip install zim_anything
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
or
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
git clone https://github.com/naver-ai/ZIM.git
|
| 41 |
+
cd ZIM; pip install -e .
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
## Usage
|
| 46 |
+
|
| 47 |
+
1. Make the directory `zim_vit_l_2092`.
|
| 48 |
+
2. Download the [encoder](https://huggingface.co/naver-iv/zim-anything-vitl/resolve/main/zim_vit_l_2092/encoder.onnx?download=true) weight and [decoder](https://huggingface.co/naver-iv/zim-anything-vitl/resolve/main/zim_vit_l_2092/decoder.onnx?download=true) weight.
|
| 49 |
+
3. Put them under the `zim_vit_b_2092` directory.
|
| 50 |
+
|
| 51 |
+
```python
|
| 52 |
+
from zim_anything import zim_model_registry, ZimPredictor
|
| 53 |
+
|
| 54 |
+
backbone = "vit_l"
|
| 55 |
+
ckpt_p = "zim_vit_l_2092"
|
| 56 |
+
|
| 57 |
+
model = zim_model_registry[backbone](checkpoint=ckpt_p)
|
| 58 |
+
if torch.cuda.is_available():
|
| 59 |
+
model.cuda()
|
| 60 |
+
|
| 61 |
+
predictor = ZimPredictor(model)
|
| 62 |
+
predictor.set_image(<image>)
|
| 63 |
+
masks, _, _ = predictor.predict(<input_prompts>)
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Citation
|
| 67 |
+
|
| 68 |
+
If you find this project useful, please consider citing:
|
| 69 |
+
|
| 70 |
+
```bibtex
|
| 71 |
+
@article{kim2024zim,
|
| 72 |
+
title={ZIM: Zero-Shot Image Matting for Anything},
|
| 73 |
+
author={Kim, Beomyoung and Shin, Chanyong and Jeong, Joonhyun and Jung, Hyungsik and Lee, Se-Yun and Chun, Sewhan and Hwang, Dong-Hyun and Yu, Joonsang},
|
| 74 |
+
journal={arXiv preprint arXiv:2411.00626},
|
| 75 |
+
year={2024}
|
| 76 |
+
}
|