English | [简体中文](README_cn.md)
# Modify-Anything: Segment Anything Meets Video and Image Modify and Picture Video Background Replacement
Modify-Anything is based on YOLO5,YOLO8, for video and image detection. Segment-anything,lama_cleaner is applied to
segment, modify, erase, and obtain the target image. The background of the target image video
can be changed, and the background of the image video can be changed.
## <span>Installation</span>
The code requires python>=3.8, as well as pytorch>=1.7 and torchvision>=0.8. Please follow the instructions here
to install both PyTorch and TorchVision dependencies. Installing both PyTorch and TorchVision with CUDA support
is strongly recommended.
To install the Modify-Anything, please follow these steps:
- The first time it runs, it will download the model itself. If the download is too slow, the phone will download and place it as follows
- Train your own YOLO5 or YOLOv8 models to detect segmentation, modification, and erasure.
The default models used in this project are "YOLOv5l. pt", "YOLOv5l6. pt", "YOLOv8l. pt", and "YOLOv8x. pt".
Please download and place them in the project root directory
- Download the Segment anything model and place it in the project root directory sam_vit_h_4b8939.pth (change to) vit_h.pth,sam_vit_l_0b3195.pth (change to) vit_l.pth,sam_vit_b_01ec64.pth (change to) vit_b.pth
- Install pip install ultralytics sahi fal_serverless lama_cleaner tqdm or pip install - r requirements. Txt
- Run python app.py
- The generated results are all in the output directory
<p align="center">
<img src="./example/1683134557206.png" alt="image" style="width:400px;">
</p>
## <span>Modify Anything Image and Picture Video Background Replacement</span>
<table>
<tr>
<td><img src="./example/image.jpg" width="100%"></td>
<td><img src="./example/images.png" width="100%"></td>
<td><img src="./example/imagemask.jpg" width="100%"></td>
</tr>
</table>
<table>
<tr>
<td><img src="./example/1683122305662.png" width="100%"></td>
<td><img src="./example/1683122435166.png" width="100%"></td>
<td><img src="./example/5.gif" width="100%"></td>
</tr>
</table>
## <span>Modify Anything Video and Picture Video Background Replacement</span>
<table>
<tr>
<td><img src="./example/2.gif" width="100%"></td>
<td><img src="./example/1.gif" width="100%"></td>
<td><img src="./example/3.gif" width="100%"></td>
</tr>
</table>
<table>
<tr>
<td><img src="./example/4.gif" width="100%"></td>
<td><img src="./example/6.gif" width="100%"></td>
</tr>
</table>
## Acknowledgments
- [LaMa](https://github.com/advimman/lama)
- [Segment Anything](https://github.com/facebookresearch/segment-anything)
- [YOLOv8](https://github.com/ultralytics/ultralytics)
## Citation
If you find this work useful for your research, please cite us:
```
@article{
title={Modify-Anything: Segment Anything Meets Video and Image Modify and Picture Video Background Replacement},
author={Zhang Jing},
year={2023}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于 YOLO5,YOLO8,用于视频和图像检测。Segment-anything,lama_cleaner应用于 分割、修改、擦除和获取目标图像。目标图像视频的背景 可以更改,并且可以更改图像视频的背景。 安装 代码需要 python>=3.8,以及 pytorch>=1.7 和 torchvision>=0.8。请按照此处的说明进行操作 安装 PyTorch 和 TorchVision 依赖项。安装支持 CUDA 的 PyTorch 和 TorchVision 强烈建议使用。 要安装 Modify-Anything,请按照下列步骤操作: 首次运行时,它将下载模型本身。如果下载速度太慢,手机将下载并放置如下 训练您自己的 YOLO5 或 YOLOv8 模型以检测分割、修改和擦除。 此项目中使用的默认模型是“YOLOv5l.pt“, ”YOLOv5l6.pt“, ”YOLOv8l.pt“和”YOLOv8x.pt“。 请下载并将它们放在项目根目录下 下载 Segment anything 模型并将其放在项目根目录中 sam_vit_h_4b8939.pth(更改为)vit_h.pt
资源推荐
资源详情
资源评论
收起资源包目录
Modify-Anything-master.zip (46个子文件)
Modify-Anything-master
app.py 10KB
metaseg
__init__.py 707B
falai_demo.py 3KB
sahi_predict.py 3KB
utils
__init__.py 276B
file_utils.py 1KB
onnx.py 6KB
transforms.py 4KB
amg.py 12KB
data_utils.py 3KB
generator
__init__.py 0B
automatic_mask_generator.py 15KB
predictor.py 11KB
build_sam.py 3KB
mask_predictor.py 8KB
modeling
__init__.py 465B
image_encoder.py 14KB
prompt_encoder.py 8KB
mask_decoder.py 6KB
common.py 1KB
sam.py 7KB
transformer.py 8KB
.idea
githubai.iml 284B
vcs.xml 180B
misc.xml 197B
inspectionProfiles
profiles_settings.xml 174B
modules.xml 268B
.gitignore 176B
requirements.txt 2KB
lamamodel.py 3KB
demo.py 10KB
example
6.gif 2.16MB
1683122435166.png 1.01MB
mask1.jpg 30KB
imagemask.jpg 173KB
image.jpg 195KB
5.gif 2.39MB
images.png 210KB
2.gif 1.9MB
3.gif 410KB
1683122305662.png 425KB
1.gif 2.22MB
4.gif 1.28MB
1683134557206.png 80KB
README.md 3KB
README_cn.md 3KB
共 46 条
- 1
资源评论
hakesashou
- 粉丝: 6766
- 资源: 1679
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于景观生态风险评价的流域景观格局优化,教学视频和资料,喜欢的就下载吧,保证受用
- java设计模式-建造者模式(Builder Pattern)
- C语言刷题-lesson5_1731564764305.pdf
- JavaScript开发指南PDG版最新版本
- JavaScript程序员参考(JavaScriptProgrammer'sReference)pdf文字版最新版本
- jQuery1.4参考指南的实例源代码实例代码最新版本
- CUMCM-2018-D.pdf
- jQueryapi技术文档chm含jQuery选择器使用最新版本
- DWIN_SET.rar
- transformer-transformer
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功