SIGGRAPH2024参考图像驱动的真实图像补全image

本文是VCC张明启同学对论文RealFill:Reference-DrivenGenerationforAuthenticImageCompletion的解读,该工作来自康奈尔大学、GoogleResearch以及SnapResearch,已被发表在计算机图形学顶级会议SIGGRAPH2024上。

该工作提出了一种真实图像补全方法,该方法允许用户使用少量的参考图像对模型进行个性化训练,通过学习输入图像的真实场景信息从而对目标图像进行补全和扩展,并且对输入的参考图像和目标图像没有严格限制,图像可以在视点、光照、风格等方面存在差异。相比于其他补全方法,RealFill补全结果能更好保持真实场景的结构和细节,而后者会产生合理但不真实的内容。

一、引言

照片捕捉了我们生活中短暂而宝贵的经历,但是在许多情况下,我们拍摄不到具有完美角度的照片。因此,人们希望可以借用图像补全技术来得到想要的图像。图像补全是计算机视觉领域的一个长期挑战,其目的是用可信的内容来填充图像缺失部分,在许多应用场景具有广泛的应用潜力。过去解决此类问题主要采用经典的基于几何的方法,这些方法依赖于特征匹配、深度估计和3D变换等操作,无法处理复杂场景。最近出现的生成模型,尤其是概率扩散模型,在图像补全和拓展任务上展现了强大的性能。然而现有生成方法仍难以恢复真实场景的结构和细节。

为了能够真实地还原场景信息,本文提出了一种参考图像驱动的图像补全方法,RealFill。该方法根据用户提供的参考图像和目标图像,对预训练的补全扩散模型进行微调,使得模型可以学习到输入图像中的场景的内容、光照和风格,然后即可使用微调后的模型通过标准的扩散采样过程补全目标图像。RealFill能够有效地根据真实场景信息对图像进行补全和拓展,即使参考图像和目标图像在视点、光照、风格等方面具有较大差别,RealFill也能够很好地处理。因为扩散模型具有不确定性,生成结果的质量参差不齐,所以本文最后设计了一种基于对应关系的种子选择策略,从多个输出中选择一组补全效果较好的图像作为最终结果。

二、技术贡献

本工作主要贡献如下:

三、方法介绍

给定一组随机捕获到的参考图像(至多5张),RealFill的目标是在缺失区域生成符合真实场景信息的内容,输出图像不仅要可信和逼真,而且要符合参考图像场景信息。RealFill的训练和推理过程如下图1所示。在训练阶段,本文根据用户输入图像,利用LoRA对预训练的补全模型进行参数微调,使得模型学习输入图像的场景信息;在推理阶段,利用微调后的模型,以特定句式“aphotoof[V]”、目标图像及其掩膜作为控制条件,并且采用现有的DenoisingDiffusionProbabilisticModels(DDPM)采样器,从一张纯噪声的图像生成最终的补全图像。

图1RealFill的训练和推理过程

不论是对于基于几何的方法,还是基于重建的方法来说,真实图像补全的任务都十分具有挑战性。这是因为该任务只有少数图像可以作为输入,在参考图像和目标图像之间几乎没有设置任何几何约束,而且参考图像可能具有与目标图像十分不同的风格和光照条件。因此,该方法首先通过在参考图像上微调预训练的生成模型,从而将场景信息注入到模型中。然后,以目标图像及掩码作为条件,使用微调后的模型补全图像,从而使得生成的图像呈现目标场景。

训练过程

RealFill的实现基于预训练的补全扩散模型,通过在训练阶段为预训练模型注入LoRA参数,并在和上用随机生成的掩膜对参数进行微调,从而使得RealFill学习到当前输入图像的场景信息。损失函数如下所示:

其中,是一个文本描述词。对于而言,损失函数只会在非缺失区域进行计算。该工作使用开源的StableDiffusionv2补全模型,并在textencoder和UNet中注入LoRA参数。在训练过程中为特定句式:“aphotoof[V]”。对于每个训练样本,该工作生成多个随机的矩形区域,取矩形的并集或者并集的补集构建随机掩模图像。

推理过程

在完成训练后,本文采用DDPM采样器生成并以、和作为模型的控制条件。在实验结果中,的非掩码区域发生了畸变,与中对应区域的内容不相符。为了解决这个问题,本文首先对掩膜进行羽化处理,然后用羽化处理过的掩膜对和做alpha混合,这样可以使最终结果的已有区域和输入图像一致,并在生成区域的边界处产生平滑过渡。

基于对应关系的种子选择

由于扩散模型的推理过程是随机的,相同的输入可以生成不同的图像。这种随机性使得生成图像的质量参差不齐,该工作将参考图像作为基准,帮助识别高质量的生成图像。具体来说,采用和之间的匹配特征点对的数量作为度量,粗略地量化结果与参考图像的相似度。

四、部分结果展示

Inpaint和outpaint

图2outpaint结果

图3inpaint结果定量评估

参考图像信息一致的内容,并且能够处理相机姿态、光照、焦外模糊、图像风格的显著差异等情况。本文与基于参考图像、基于提示词的两组基线方法进行了比较,并在RealBench数据集上对所有方法进行了定量评估。RealFill在所有指标上都优于另外两种方法,如表1所示:

表1RealFill与基准方法的定量评估

图4展示了上述评估的可视化结果,与基准方法相比,RealFill不仅能够生成高质量的图像,而且补全的内容更加符合输入图像的场景信息。

图4与基准方法定量评估的可视化结果基于对应关系的种子选取

五、总结与展望

本文首先介绍了一种新的真实图像补全任务,给定一组参考图像,本工作希望补全图像的内容符合输入图像的真实场景信息。为此,本文提出了一种简单但有效的方法RealFill,该方法首先用参考图像和目标图像对T2I补全扩散模型进行微调,然后使用微调后的模型补全目标图像的缺失区域。实验结果表明,RealFill能输出高质量、符合参考图像真实场景信息的补全结果,即使参考图像与目标图像之间存在视点、光照、风格等方面的差异,RealFill的表现也同样出色。

六、思考与讨论

Q:RealFill还存在着哪些不足?

A:当参考图像与目标图像之间的视点差异过大时,比如只有一张参考图像,此时RealFill的结果通常无法还原场景信息。另外,由于RealFill在学习输入图像的场景信息时是一个基于梯度优化的过程,因此RealFill的训练速度很慢。

Q:参考图像的选择是否会影响RealFill的结果?

A:根据经验,当有参考图像的数量更多时,或者当参考图像在视点、光照等方面与目标图像差异较小时,RealFill能够输出更好的结果,如图6所示:

图6参考图像的选择对结果的影响

以下是开放性问题,欢迎读者朋友留言讨论:

Q:是否可以将RealFill对场景内容的学习能力用来做图像生成,通过将不同场景的结构和风格融合在一起,从而创建新的场景或者纹理?

参考文献

[1]LumingTang,MenglinJia,QianqianWang,ChengPerngPhoo,BharathHariharan.Emergentcorrespondencefromimagediffusion.AdvancesinNeuralInformationProcessingSystems(NeurIPS).1363-1389,2023.

[2]HuiwenChang,HanZhang,LuJiang,CeLiu,WilliamT.Freeman.Maskgit:Maskedgenerativeimagetransformer.ConferenceonComputerVisionandPatternRecognition(CVPR).11315-11325,2022.

[3]RobinRombach,AndreasBlattmann,DominikLorenz,PatrickEsser,BjornOmmer.High-resolutionimagesynthesiswithlatentdiffusionmodels.ConferenceonComputerVisionandPatternRecognition(CVPR).10684-10695,2022.

[4]NatanielRuiz,YuanzhenLi,VarunJampani,YaelPritch,MichaelRubinstein,KfirAberman.Dreambooth:Finetuningtext-to-imagediffusionmodelsforsubject-drivengeneration.ConferenceonComputerVisionandPatternRecognition(CVPR).22500-22510,2023.

llustrationFromIconScoutByIconScoutStore

-TheEnd-

扫码观看!

本周上新!

“AI技术流”原创投稿计划

TechBeat是由将门创投建立的AI学习社区(

投稿内容

//前沿资讯解说/心得经历讲述//

投稿须知

投稿方式

发送邮件到

melodybai@thejiangmen.com

关于我“门”

将门是一家以专注于数智核心科技领域的新型创投机构,也是北京市标杆型孵化器。公司致力于通过连接技术与商业,发掘和培育具有全球影响力的科技创新企业,推动企业创新发展与产业升级。

将门成立于2015年底,创始团队由微软创投在中国的创始团队原班人马构建而成,曾为微软优选和深度孵化了126家创新的技术型创业公司。

如果您是技术领域的初创企业,不仅想获得投资,还希望获得一系列持续性、有价值的投后服务,欢迎发送或者推荐项目给我“门”:

THE END
1.怎么把侧面照片变成正面pythonmob6454cc6a8ab0的技术博客"""# 读入图像im=array(Image.open('../data/empire.jpg').convert('L'))# 检测harris角点harrisim=harris.compute_harris_response(im)# Harris响应函数harrisim1=255-harrisimfigure()gray()#画出Harris响应图subplot(141)imshow(harrisim1)printharrisim1.shapeaxis('off')axis('equal')threshold=[0.01,https://blog.51cto.com/u_16099229/12804065
2.fer2013面部表情数据集各位大佬有没有fer2013数据集的变种数据集为此,开发了几种方法,包括FACEM和FACS方法。一旦建立了定量框架,向基于计算机视觉(CV)的分析过渡就https://www.zhihu.com/question/627287826/answer/53787224319
3.深度学习之图像分类:从零完成人脸表情识别案例实践(第7节)基于嘴唇识别大部分的表情。 提取嘴唇区域:人脸在哪?嘴唇这个关键部位在哪? 1、openCV自带的算法-基于cascade的人脸检测算法。可以快速检测到正面的人面。cv2.CascadeClassifier接口 2、d-lab获取人脸关键点区域 d lab sharp predict接口 -调用cascade.detectMultiScale检测人面 https://www.bilibili.com/opus/1009817068385599494
4.facialrecognitionissoftwareIn this web dossier, you will discover the seven face recognition facts and trends that shape the landscape in 2021. TheE.U. Commissionplans to act on the indiscriminate use of facial identifier technology. The European Commission president Ursula von der Leyen wantshttps://www.thalesgroup.com/en/markets/digital-identity-and-security/government/biometrics/facial-recognition
5.Facebooksoftware to hide advertisements, the users are younger and therefore are better at ignoring Identifier Separation Protocol (LISP), which separates Internet addresses from endpoint identifiers to“Facebook Bill of Rights and Responsibilities” to give their input and help shape the new https://www.translationdirectory.com/articles/article2297.php
6.FantasticAdviceforStartingYourOwnSoftwareCompanyWho?s the audience that needs your software? Identify as many as you can, but be realistic: Facebook may work for 87-year-old grandmothers and 17-year-old teenage boys at the same time, but it's taken a decade and billions of dollars to get to that point. Don't try to tackle https://www.codemag.com/Article/1801061/A-Good-Idea-is-Just-the-Start
7.CreditLost:TwoDecadesofSoftwareCitationinAstronomyA URL is just another piece of metadata that can be associated with a persistent identifier. For example, software deposited in Zenodo gets archived and assigned a DOI. The record associated with the archival deposit includes updatable metadata fields (e.g., related links), but the DOI will https://iopscience.iop.org/article/10.3847/1538-4365/ab7be6
8.AnoverviewoftechnologiessupportingtheuseofcolourNote, too, that HarfBuzz is used to process and shape Unicode emoji text characters, which we’ll explore in more detail. The following graphic summarises the role played by HarfBuzz when integrated with software, such as XeTeX or LuaHBTeX, during typesetting text in a complex shttp://www.overleaf.com/learn/latex/Articles/An_overview_of_technologies_supporting_the_use_of_colour_emoji_fonts_in_LaTeX
9.DataProtectionMANTruck&Busin particular by reference to an identifier such as a name, identification number, location data, online identifier, or to one or more particularh) Integration of social media plug-ins (Facebook, Twitter) Plug-ins are computer programs that are integrated into another software product, suchhttps://www.mantruckandbus.com/en/meta/data-protection.html
10.ARFaceDatabase人脸识别数据集'xx' is a unique person identifier (from "00" to "70" for males and from "00" to "56" for females) 'yy' specifies the features of each2.Manual Annotations: This file contains four (4) different manual annotations of the shape of each of the facial components of the faces in tehttps://blog.csdn.net/GarfieldEr007/article/details/51480549
11.ofFacialFeaturesinMagneticResonanceImages:Softwarepart of the face, the area that covers the entire range of the nose was deleted to make it impossible to infer the original shape of the yeonuk-Jeong / De-facer: De-identifier reconstructable facial information in Medical image (CT, MRI). GitHub. 2020. URL: https://github.com/http://dx.doi.org/10.2196/22739
12.Howdifferentisdifferent?CriterionandsensitivityinfaceBoth types of scanner record information about surface color as well as shape, and this information was used to define an average surface color which was applied to all stimuli. Synthetic face models were imported to Blender v2.45 (www. blender.com), an open source 3D modeling software https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2011.00041/pdf
13.RecentAdvancesinDeepLearningTechniquesforFaceDigital Object Identifier https://doi.org/10.1109/ACCESS.2021.3096136 Recent Advances in Deep Learning Techniques for Face Recognition MD. TAHMID HASANSome face align- ment methods are Active Appearance Model (AAM) [6], 2 Active Shape Model (ASM) [7]. Those aligned faces are used for http://arxiv.org/pdf/2103.10492
14.BenchmarkingcommonlyusedsoftwaresuitesandanalysisOf note, previous studies have demonstrated that in silico libraries built on proteome-scale protein sequence databases face a key challenge of In brief, all modules in the ion intensity model were loaded except the final FC layers which would output the tensor with a shape of \({pephttps://www.nature.com/articles/s41467-022-35740-1
15.Feishuandroid-shape-imageview, AndroidJUnitRunner rules, AndroidSVG, AndroidX Ads Identifier, AndroidX Ads Identifier Common, AndroidX Futures, AndroidX Room XProcessor, AndroidX Test Library - core, AndroidX Test Library - espresso-contrib, AndroidX Test Library - espresso-core, AndroidX Test Library https://www.feishu.cn/legal/open-source-software-notice-android
16.CATIA3DCAD&SimulationSoftwareconstruction professionals, and all contributors can define, imagine, and shape the connected worldworked closely for several months to align the project from a hardware and software point of used to distinguish unique users by assigning a randomly generated number as a client identifier.https://enterprise.trimech.com/catia/
17.StructuralInsightintotheCoreofCAD,theMultifunctionalA second ctDHOlike-ATC crystal type with a diamond shape grew in the absence and presence of REAGENT or RESOURCESOURCEIDENTIFIER Bacterial and Virus Strains BL21 (DE3) pLysS Escherichia coli cellsData and Software Availability All software used for this work are indicated in the Key Resourceshttps://www.sciencedirect.com/science/article/pii/S0969212617301302
18.KioskDispenserInteractiveOriginalOrderEntrySoftwareand an identifier for one of a plurality of drug dispensing kiosks from which the new prescription5. SHAPE: ideal is rectangular or oval with slightly rounded bottom (to prevent ‘crabbing’)source of illumination when the door is opened sufficient to light up the face of an intruder.https://www.freepatentsonline.com/y2019/0163876.html