本模型选自Pait by Example, 根据示例图片对原始图片的mask区域进行自适应地替换。 Pait by Example 是基于stable diffusio 模型的一个图像编辑算法,根据示例图片对原始图片的mask区域进行自适应地替换。 本模型适用范围为室外自然场景; 在ModelScope框架上,提供输入图片,即可通过简单的Pipelie调用来使用。 安装好基础modelscope环境后,安装pait-ldm: pip istall pait-ldm -f https://modelscope.oss-c-beijig.aliyucs.com/releases/repo.html 如果你觉得这个该模型对有所帮助,请考虑引用下面的相关的论文:Pait by Example 图像示例替换
模型描述
期望模型使用方式以及适用范围
如何使用
环境安装
代码范例
from PIL import Image
import cv2
from modelscope.outputs import OutputKeys
from modelscope.pipelies import pipelie
from modelscope.utils.costat import Tasks
iput_locatio = 'https://modelscope.oss-c-beijig.aliyucs.com/test/images/image_pait_by_example/image/example_1.pg'
iput_mask_locatio = 'https://modelscope.oss-c-beijig.aliyucs.com/test/images/image_pait_by_example/mask/example_1.pg'
referece_locatio = 'https://modelscope.oss-c-beijig.aliyucs.com/test/images/image_pait_by_example/referece/example_1.jpg'
iput = {
'img':iput_locatio,
'mask':iput_mask_locatio,
'referece':referece_locatio,
}
paitbyexample = pipelie(Tasks.image_paitbyexample, model='damo/cv_stable-diffusio_pait-by-example')
result = paitbyexample(iput)
vis_img = result[OutputKeys.OUTPUT_IMG]
cv2.imwrite("result.pg", vis_img)
模型局限性以及可能的偏差
训练数据介绍
引用
@article{yag2022pait,
title={Pait by Example: Exemplar-based Image Editig with Diffusio Models},
author={Bixi Yag ad Shuyag Gu ad Bo Zhag ad Tig Zhag ad Xueji Che ad Xiaoya Su ad Dog Che ad Fag We},
joural={arXiv preprit arXiv:2211.13227},
year={2022}
}
点击空白处退出提示
评论