当前位置:   article > 正文

如何在数字世界复刻一个高还原、高拟真的“你”?

如何在数字世界复刻一个高还原、高拟真的“你”?
本文为「云端智能剪辑」实践指南第五期,通过阿里云智能媒体服务IMS完成数字人形象训练、人声克隆定制,并使用Timeline实现视频合成及创作,打造一个“声形俱佳”的数字分身。

橙鲤|作者

形象日益逼真、交互更为顺畅,虚拟数字人在视频内容生产环节的应用越来越多。复刻一个不受空间、时间的限制,具有专属声音、形象的“我”,竟如此简单?

我们先来看一则运用数字人形象定制及人声克隆后合成的成片效果:https://v.youku.com/v_show/id_XNjI3Mzk1NTM2NA==.html

示例视频中的主播形象、人物语音,并非是通过拍摄剪辑形成的,而是通过数字人形象训练和人声克隆,生成对应的形象与声音模型,并调用智能媒体服务的视频剪辑合成接口生成的最终成片。

本文,我们将逐步介绍数字人形象训练及人声克隆的步骤过程,并附以详细的剪辑合成Timeline代码示例,三步在数字世界复刻一个“我”。

01 数字人形象训练

首先,我们需要训练出一个数字分身,无论是动作、表情、还是口型等,都能够达到高还原度的拟真效果。

「数字人形象定制」主要包含准备训练素材、提交训练、生成AvatarId三个步骤。

l 准备训练素材

1个训练视频(Video)和1张头像图片(Portrait)

设备选择、场地要求、模特形象、录制过程等具体拍摄指南,可参考:

https://help.aliyun.com/document_detail/2393251.html

l 提交训练

通过控制台进行提交训练,依据提示,填入数字人名称、描述、头像图片与训练视频素材等,点击「开始定制」,即可开始训练。

控制台链接:

https://ice.console.aliyun.com/production/avatar2d/create

其中,数字人形象支持传入带透明通道(无背景、已抠图)与不带透明通道(有背景、未抠图)两种不同类型的素材,可以按需传入。

l 生成AvatarId

当训练完成后,您将获得模型的唯一标识 AvatarId,可以使用该ID合成数字人视频。

同时,通过点击「数字人」列表页中的「视频剪辑」按钮,使用数字人形象生成视频,并进行二次剪辑创作。

您可以选择是由「文字驱动」或是「音频驱动」合成数字人视频。

以「文字驱动」为例:输入文本内容,选择官方人声效果(亦可选择通过人声克隆生成的声音模型,详见第二步)即可生成数字人视频。

数字人视频合成效果如下:https://v.youku.com/v_show/id_XNjI3Mzk1NTc0MA==.html

02 人声克隆

当有了高度拟真的数字人形象,我们还需要同步拟真的声音,进一步提升“数字分身”的生动感、完整度。

「人声克隆」主要包含准备训练素材、提交训练、生成VoiceId三个步骤。

l 准备训练素材

若干训练音频(Audio)和 1 个安全认证音频(Authentication)

l 提交训练

通过控制台提交训练,填入声音名称、安全认证音频、训练音频等,点击「开始定制」,即可开始训练。

控制台链接:

https://ice.console.aliyun.com/production/voiceCopy/createStandard

l 生成VoiceId

训练完成后,您将获得模型的唯一标识 VoiceId,可以通过点击「人声克隆 - 大众版」列表页中的「语音合成」按钮,来使用当前声音模型进行语音合成。

人声克隆-大众版列表页

输入文字内容,点击「开始试听」按钮,即可提交智能语音合成。

运用人生克隆语音合成后效果如下:

语音合成示例音频 1

我们也可以与训练时传入的原始音频进行效果对比:

原始训练声音(截取)

03 一键“复刻”

在获得数字人形象模型的 AvatarId 与专属人声的 VoiceId 后,除了通过文章前述的控制台来进行提交合成,还可以通过时间线Timeline一次提交生成,完成一键“复刻”。

Timeline示例如下:

  1. {
  2. "VideoTracks": [{
  3. "VideoTrackClips": [{
  4. "Type": "GlobalImage",
  5. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image1.jpg",
  6. "Height": 1920,
  7. "Width": 1080
  8. }]
  9. }, {
  10. "VideoTrackClips": [{
  11. "Type": "Image",
  12. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image2.png",
  13. "Height": 1920,
  14. "Width": 1080,
  15. "Duration": 2,
  16. "Effects": [{
  17. "Type": "Text",
  18. "Content": "什么是数字人和人声克隆?",
  19. "Alignment": "CenterCenter",
  20. "FontSize": 80,
  21. "EffectColorStyle": "CS0001-000001"
  22. }]
  23. },{
  24. "Type": "AI_Avatar",
  25. "AvatarId": "Avatar-******",
  26. "CustomizedVoice": "Voice-******",
  27. "Content": "数字人和人声克隆是两个前沿的技术概念\n它们代表着数字技术在模拟人类外观和声音方面的最新成就",
  28. "ClipId": "avatar1",
  29. "Effects": [{
  30. "Type": "AI_ASR",
  31. "FontSize": 60,
  32. "Alignment": "TopCenter",
  33. "Y": 1670,
  34. "EffectColorStyle": "CS0001-000007",
  35. "AdaptMode": "AutoWrap",
  36. "TextWidth": 0.8
  37. }]
  38. },{
  39. "Type": "Image",
  40. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image2.png",
  41. "Height": 1920,
  42. "Width": 1080,
  43. "Duration": 2,
  44. "Effects": [{
  45. "Type": "Text",
  46. "Content": "数字人",
  47. "Alignment": "CenterCenter",
  48. "FontSize": 150,
  49. "EffectColorStyle": "CS0001-000001"
  50. }]
  51. }, {
  52. "Type": "AI_Avatar",
  53. "AvatarId": "Avatar-******",
  54. "CustomizedVoice": "Voice-******",
  55. "Content": "数字人\n通常指由计算机生成的虚拟人类形象\n这些形象可以是二维(2D)或三维(3D)的\n具有与现实人类相似的外观、动作和行为\n随着图形渲染技术的进步\n数字人越来越能够以高度逼真的方式呈现\n包括复杂的面部表情、肢体动作\n并能在虚拟环境中以自然的方式行动",
  56. "ClipId": "avatar2",
  57. "Effects": [{
  58. "Type": "AI_ASR",
  59. "FontSize": 60,
  60. "Alignment": "TopCenter",
  61. "Y": 1670,
  62. "EffectColorStyle": "CS0001-000007",
  63. "AdaptMode": "AutoWrap",
  64. "TextWidth": 0.8
  65. }]
  66. }, {
  67. "Type": "Image",
  68. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image2.png",
  69. "Height": 1920,
  70. "Width": 1080,
  71. "Duration": 2,
  72. "Effects": [{
  73. "Type": "Text",
  74. "Content": "数字人的应用",
  75. "Alignment": "CenterCenter",
  76. "FontSize": 120,
  77. "EffectColorStyle": "CS0001-000001"
  78. }]
  79. },{
  80. "Type": "AI_Avatar",
  81. "AvatarId": "Avatar-******",
  82. "CustomizedVoice": "Voice-******",
  83. "Content": "数字人的应用范围极其广泛",
  84. "ClipId": "avatar3",
  85. "Effects": [{
  86. "Type": "AI_ASR",
  87. "FontSize": 60,
  88. "Alignment": "TopCenter",
  89. "Y": 1670,
  90. "EffectColorStyle": "CS0001-000007",
  91. "AdaptMode": "AutoWrap",
  92. "TextWidth": 0.8
  93. }]
  94. }, {
  95. "Type": "AI_Avatar",
  96. "AvatarId": "Avatar-******",
  97. "CustomizedVoice": "Voice-******",
  98. "Content": "从电子游戏、电影和电视制作",
  99. "ClipId": "avatar4",
  100. "Effects": [{
  101. "Type": "AI_ASR",
  102. "FontSize": 60,
  103. "Alignment": "TopCenter",
  104. "Y": 1670,
  105. "EffectColorStyle": "CS0001-000007",
  106. "AdaptMode": "AutoWrap",
  107. "TextWidth": 0.8
  108. }]
  109. }, {
  110. "Type": "AI_Avatar",
  111. "AvatarId": "Avatar-******",
  112. "CustomizedVoice": "Voice-******",
  113. "Content": "到增强现实(AR)和虚拟现实(VR)体验等",
  114. "ClipId": "avatar5",
  115. "Effects": [{
  116. "Type": "AI_ASR",
  117. "FontSize": 60,
  118. "Alignment": "TopCenter",
  119. "Y": 1670,
  120. "EffectColorStyle": "CS0001-000007",
  121. "AdaptMode": "AutoWrap",
  122. "TextWidth": 0.8
  123. }]
  124. }, {
  125. "Type": "AI_Avatar",
  126. "AvatarId": "Avatar-******",
  127. "CustomizedVoice": "Voice-******",
  128. "Content": "到在线教育、模拟训练、客户服务和健康护理",
  129. "ClipId": "avatar6",
  130. "Effects": [{
  131. "Type": "AI_ASR",
  132. "FontSize": 60,
  133. "Alignment": "TopCenter",
  134. "Y": 1670,
  135. "EffectColorStyle": "CS0001-000007",
  136. "AdaptMode": "AutoWrap",
  137. "TextWidth": 0.8
  138. }]
  139. }, {
  140. "Type": "AI_Avatar",
  141. "AvatarId": "Avatar-******",
  142. "CustomizedVoice": "Voice-******",
  143. "Content": "在这些应用中\n数字人可以作为用户的虚拟代表\n或者作为虚拟助手和顾问\n提供帮助和咨询\n在娱乐产业中",
  144. "ClipId": "avatar7",
  145. "Effects": [{
  146. "Type": "AI_ASR",
  147. "FontSize": 60,
  148. "Alignment": "TopCenter",
  149. "Y": 1670,
  150. "EffectColorStyle": "CS0001-000007",
  151. "AdaptMode": "AutoWrap",
  152. "TextWidth": 0.8
  153. }]
  154. }, {
  155. "Type": "AI_Avatar",
  156. "AvatarId": "Avatar-******",
  157. "CustomizedVoice": "Voice-******",
  158. "Content": "数字人可以被用来创造虚构角色\n甚至在某些情况下代替真实的演员进行表演",
  159. "ClipId": "avatar8",
  160. "Effects": [{
  161. "Type": "AI_ASR",
  162. "FontSize": 60,
  163. "Alignment": "TopCenter",
  164. "Y": 1670,
  165. "EffectColorStyle": "CS0001-000007",
  166. "AdaptMode": "AutoWrap",
  167. "TextWidth": 0.8
  168. }]
  169. }, {
  170. "Type": "AI_Avatar",
  171. "AvatarId": "Avatar-******",
  172. "CustomizedVoice": "Voice-******",
  173. "Content": "而在商业领域\n数字人可以用作品牌大使或虚拟员工\n增加用户互动的吸引力",
  174. "ClipId": "avatar9",
  175. "Effects": [{
  176. "Type": "AI_ASR",
  177. "FontSize": 60,
  178. "Alignment": "TopCenter",
  179. "Y": 1670,
  180. "EffectColorStyle": "CS0001-000007",
  181. "AdaptMode": "AutoWrap",
  182. "TextWidth": 0.8
  183. }]
  184. }, {
  185. "Type": "AI_Avatar",
  186. "AvatarId": "Avatar-******",
  187. "CustomizedVoice": "Voice-******",
  188. "Content": "在教育和训练场景中\n数字人能够模拟不同的情境\n提供更加丰富和互动的学习体验",
  189. "ClipId": "avatar10",
  190. "Effects": [{
  191. "Type": "AI_ASR",
  192. "FontSize": 60,
  193. "Alignment": "TopCenter",
  194. "Y": 1670,
  195. "EffectColorStyle": "CS0001-000007",
  196. "AdaptMode": "AutoWrap",
  197. "TextWidth": 0.8
  198. }]
  199. },{
  200. "Type": "Image",
  201. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image2.png",
  202. "Height": 1920,
  203. "Width": 1080,
  204. "Duration": 2,
  205. "Effects": [{
  206. "Type": "Text",
  207. "Content": "人声克隆",
  208. "Alignment": "CenterCenter",
  209. "FontSize": 150,
  210. "EffectColorStyle": "CS0001-000001"
  211. }]
  212. }, {
  213. "Type": "AI_Avatar",
  214. "AvatarId": "Avatar-******",
  215. "CustomizedVoice": "Voice-******",
  216. "Content": "人声克隆是指使用计算机算法模仿特定人的声音\n这项技术通过分析一个人的语音记录\n捕捉其独特的声音特征\n如音高、音色、语速和口音\n并创建一个可以产生类似声音的模型\n人声克隆技术往往建立在深度学习和神经网络的基础上\n通过大量的声音训练数据\n使得合成的声音越来越难以与原声区分",
  217. "ClipId": "avatar11",
  218. "Effects": [{
  219. "Type": "AI_ASR",
  220. "FontSize": 60,
  221. "Alignment": "TopCenter",
  222. "Y": 1670,
  223. "EffectColorStyle": "CS0001-000007",
  224. "AdaptMode": "AutoWrap",
  225. "TextWidth": 0.8
  226. }]
  227. }, {
  228. "Type": "Image",
  229. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image2.png",
  230. "Height": 1920,
  231. "Width": 1080,
  232. "Duration": 2,
  233. "Effects": [{
  234. "Type": "Text",
  235. "Content": "人声克隆的应用",
  236. "Alignment": "CenterCenter",
  237. "FontSize": 120,
  238. "EffectColorStyle": "CS0001-000001"
  239. }]
  240. }, {
  241. "Type": "AI_Avatar",
  242. "AvatarId": "Avatar-******",
  243. "CustomizedVoice": "Voice-******",
  244. "Content": "人声克隆可以用在多个方面",
  245. "ClipId": "avatar12",
  246. "Effects": [{
  247. "Type": "AI_ASR",
  248. "FontSize": 60,
  249. "Alignment": "TopCenter",
  250. "Y": 1670,
  251. "EffectColorStyle": "CS0001-000007",
  252. "AdaptMode": "AutoWrap",
  253. "TextWidth": 0.8
  254. }]
  255. }, {
  256. "Type": "AI_Avatar",
  257. "AvatarId": "Avatar-******",
  258. "CustomizedVoice": "Voice-******",
  259. "Content": "例如为无法亲自录音的艺术家复原声音",
  260. "ClipId": "avatar13",
  261. "Effects": [{
  262. "Type": "AI_ASR",
  263. "FontSize": 60,
  264. "Alignment": "TopCenter",
  265. "Y": 1670,
  266. "EffectColorStyle": "CS0001-000007",
  267. "AdaptMode": "AutoWrap",
  268. "TextWidth": 0.8
  269. }]
  270. }, {
  271. "Type": "AI_Avatar",
  272. "AvatarId": "Avatar-******",
  273. "CustomizedVoice": "Voice-******",
  274. "Content": "或为语音辅助设备提供更自然的语音输出",
  275. "ClipId": "avatar14",
  276. "Effects": [{
  277. "Type": "AI_ASR",
  278. "FontSize": 60,
  279. "Alignment": "TopCenter",
  280. "Y": 1670,
  281. "EffectColorStyle": "CS0001-000007",
  282. "AdaptMode": "AutoWrap",
  283. "TextWidth": 0.8
  284. }]
  285. }, {
  286. "Type": "AI_Avatar",
  287. "AvatarId": "Avatar-******",
  288. "CustomizedVoice": "Voice-******",
  289. "Content": "它也可以帮助有语音障碍的人恢复他们的声音",
  290. "ClipId": "avatar15",
  291. "Effects": [{
  292. "Type": "AI_ASR",
  293. "FontSize": 60,
  294. "Alignment": "TopCenter",
  295. "Y": 1670,
  296. "EffectColorStyle": "CS0001-000007",
  297. "AdaptMode": "AutoWrap",
  298. "TextWidth": 0.8
  299. }]
  300. }, {
  301. "Type": "AI_Avatar",
  302. "AvatarId": "Avatar-******",
  303. "CustomizedVoice": "Voice-******",
  304. "Content": "或用于个性化的语音合成服务\n如定制语音导航或个人助理",
  305. "ClipId": "avatar16",
  306. "Effects": [{
  307. "Type": "AI_ASR",
  308. "FontSize": 60,
  309. "Alignment": "TopCenter",
  310. "Y": 1670,
  311. "EffectColorStyle": "CS0001-000007",
  312. "AdaptMode": "AutoWrap",
  313. "TextWidth": 0.8
  314. }]
  315. }, {
  316. "Type": "AI_Avatar",
  317. "AvatarId": "Avatar-******",
  318. "CustomizedVoice": "Voice-******",
  319. "Content": "人声克隆技术可以为数字人提供声线\n使得虚拟角色不仅在视觉上\n还在听觉上都显得栩栩如生\n具有高度自然语音的数字人能够提供更加动态和亲切的交互体验\n从而在各种虚拟场景中担任重要角色",
  320. "ClipId": "avatar17",
  321. "Effects": [{
  322. "Type": "AI_ASR",
  323. "FontSize": 60,
  324. "Alignment": "TopCenter",
  325. "Y": 1670,
  326. "EffectColorStyle": "CS0001-000007",
  327. "AdaptMode": "AutoWrap",
  328. "TextWidth": 0.8
  329. }]
  330. },{
  331. "Type": "Image",
  332. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image2.png",
  333. "Height": 1920,
  334. "Width": 1080,
  335. "Duration": 2,
  336. "Effects": [{
  337. "Type": "Text",
  338. "Content": "总结",
  339. "Alignment": "CenterCenter",
  340. "FontSize": 150,
  341. "EffectColorStyle": "CS0001-000001"
  342. }]
  343. }, {
  344. "Type": "AI_Avatar",
  345. "AvatarId": "Avatar-******",
  346. "CustomizedVoice": "Voice-******",
  347. "Content": "结合数字人和人声克隆技术\n我们可以创造出能够在屏幕上以二维形象出现并以逼真的人声进行沟通的虚拟代表\n这种结合提供了丰富的用户体验\n并在教育、娱乐、客户服务等各种场景中拥有潜在的应用价值",
  348. "ClipId": "avatar18",
  349. "Effects": [{
  350. "Type": "AI_ASR",
  351. "FontSize": 60,
  352. "Alignment": "TopCenter",
  353. "Y": 1670,
  354. "EffectColorStyle": "CS0001-000007",
  355. "AdaptMode": "AutoWrap",
  356. "TextWidth": 0.8
  357. }]
  358. }]
  359. },{
  360. "VideoTrackClips": [{
  361. "Type": "Image",
  362. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image3.png",
  363. "ReferenceClipId": "avatar4"
  364. },{
  365. "Type": "Image",
  366. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image4.png",
  367. "ReferenceClipId": "avatar5"
  368. },{
  369. "Type": "Image",
  370. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image5.png",
  371. "ReferenceClipId": "avatar6"
  372. },{
  373. "Type": "Image",
  374. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image6.png",
  375. "ReferenceClipId": "avatar8"
  376. },{
  377. "Type": "Image",
  378. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image7.png",
  379. "ReferenceClipId": "avatar9"
  380. },{
  381. "Type": "Image",
  382. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image8.png",
  383. "ReferenceClipId": "avatar10"
  384. },{
  385. "Type": "Image",
  386. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image9.png",
  387. "ReferenceClipId": "avatar13"
  388. },{
  389. "Type": "Image",
  390. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image10.png",
  391. "ReferenceClipId": "avatar14"
  392. },{
  393. "Type": "Image",
  394. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image11.png",
  395. "ReferenceClipId": "avatar15"
  396. },{
  397. "Type": "Image",
  398. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image12.png",
  399. "ReferenceClipId": "avatar16"
  400. }]
  401. },{
  402. "VideoTrackClips": [{
  403. "Type": "GlobalImage",
  404. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/image13.png",
  405. "Width": 312,
  406. "Height": 72,
  407. "X": 0,
  408. "Y": 1848
  409. }]
  410. }],
  411. "AudioTracks": [{
  412. "AudioTrackClips": [{
  413. "MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/audio1.wav",
  414. "LoopMode": true,
  415. "Effects": [{
  416. "Type": "Volume",
  417. "Gain": "0.2"
  418. }]
  419. }]
  420. }]
  421. }

各API文档链接:

1.SubmitAvatarVideoJob - 提交数字人视频合成任务:https://help.aliyun.com/document_detail/2260302.html

2.SubmitAudioProduceJob - 提交智能语音任务:https://help.aliyun.com/document_detail/441169.html

3.SubmitMediaProducingJob - 提交剪辑合成任务:https://help.aliyun.com/document_detail/441147.html

值得一提的是,本示例中用到的口播文案、图片、音乐等都完全是由各类生成模型生成的,也就是说,该视频的输入只有一段话:“请介绍一下数字人与人声克隆技术”。

敬请期待云端智能剪辑即将推出的「一键成片」功能,仅需要输入一个词、一段话,和极其简单的配置,即可生成一段高质量的视频。

智能媒体服务IMS「云端智能剪辑」是基于云计算和人工智能技术的视频剪辑生产服务,能为用户提供直播剪辑、视频剪辑、模版工厂、数字人制作等核心功能,并可使用 AI 辅助剪辑生产。该产品可广泛应用于互联网、文化传媒、广告营销、教育金融等行业,满足企业进行规模、高效、便捷、智能的视频内容生产需求。

欢迎加入官方答疑钉钉群咨询交流:48335001108

查看「数字人与人声克隆」产品文档:https://help.aliyun.com/document_detail/2358194.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/108995
推荐阅读
相关标签
  

闽ICP备14008679号