Commit 1b475c9a authored by bailuo's avatar bailuo
Browse files

Update README.md

parent 9058174b
......@@ -7,6 +7,7 @@ Matting-Anything 一种交互式自然图像抠图模型。
## 模型结构
<!-- 此处一句话简要介绍模型结构 -->
Matting Anything Model (MAM) 一个通用框架,能够使用单个模型解决各种类型的图像抠图场景。
<div align=center>
<img src="./doc/Architecture.png"/>
......@@ -16,7 +17,6 @@ Matting-Anything 一种交互式自然图像抠图模型。
## 算法原理
Matting Anything Model (MAM) 一个通用框架,能够使用单个模型解决各种类型的图像抠图场景。\
MAM 基于 Segment Anything Model (SAM) 的基础上,利用 SAM 输出带有mask的特征图,进一步迭代细化得到最终的 alpha matte。因为冻结了 SAM 部分的参数,整个框架只有 MAM 模块的270万个参数。Matting Anything 整个框架集成了框、点或文本提示等交互方式,而且还启用了SD模型用来生成虚拟背景图片,增加了抠图的可玩性和互动性。
......@@ -29,7 +29,7 @@ mv matting-anything_pytoch matting-anything # 去框架名后缀
### Docker(方法一)
<!-- 此处提供[光源](https://www.sourcefind.cn/#/service-details)拉取docker镜像的地址与使用步骤 -->
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.2-py3.10 # 本镜像imageID为:2f1f619d0182
docker pull image.sourcefind.cn:5000/dcu/admin/base/jupyterlab-pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10-scnet # 本镜像imageID为:38b7960be788
docker run -it -v /path/your_code_data/:/path/your_code_data/ -v /opt/hyhal/:/opt/hyhal/:ro --shm-size=16G --privileged=true --device=/dev/kfd --device=/dev/dri/ --group-add video --network=host --name docker_name imageID bash
cd /your_code_path/matting-anything
pip install -r requirements.txt
......@@ -60,7 +60,7 @@ pip install --upgrade diffusers[torch]
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.hpccube.com/tool/)开发者社区下载安装。
```
DTK驱动: dtk24.04.2
DTK驱动: dtk24.04.1
python: python3.10
pytorch: 2.1.0
```
......@@ -86,15 +86,16 @@ pip install --upgrade diffusers[torch]
<!-- 下载 [sam_vit_h_4b8939.pth](https://github.com/facebookresearch/segment-anything?tab=readme-ov-file#model-checkpoints)
或者从 [SCNet](http://113.200.138.88:18080/aimodels/findsource-dependency/sam_vit_h_4b8939) 上快速下载; -->
下载 [GroundingDINO-T](https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth) 或者从 [SCNet]() 上快速下载;
下载 [GroundingDINO-T](https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth) 或者从 [SCNet](http://113.200.138.88:18080/aimodels/idea-research/GroundingDINO.git) 上快速下载;
下载 [MAM](https://drive.google.com/drive/folders/1Bor2jRE0U-U6PIYaCm6SZY7qu_c1GYfq?usp=sharing) 或者从 [SCNet]() 上快速下载。
下载 [MAM](https://drive.google.com/drive/folders/1Bor2jRE0U-U6PIYaCm6SZY7qu_c1GYfq?usp=sharing) 或者从 [SCNet](http://113.200.138.88:18080/aimodels/findsource-dependency/matting-anything.git) 上快速下载。
并放在 ./checkpoints 下。
可视化webui推理:
```
export HF_ENDPOINT=https://hf-mirror.com
python gradio_app.py --listen
```
<div align=center>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment