当前位置: 首页 > news >正文

中企动力提供网站建设南京市网站seo整站优化

中企动力提供网站建设,南京市网站seo整站优化,网站建设常识,镇江外贸型网站建设目录 一.引言 二.gif_to_png 三.gfp_gan 四.png_to_gif 五.总结 一.引言 前面我们介绍了 GFP-GAN 提高人脸质量 与 OCR 提取视频台词、字幕,前者可以提高图像质量,后者可以从视频中抽帧,于是博主便想到了将二者进行结合并优化人物 GIF …

目录

一.引言

二.gif_to_png

三.gfp_gan

四.png_to_gif

五.总结


一.引言

前面我们介绍了 GFP-GAN 提高人脸质量 与 OCR 提取视频台词、字幕,前者可以提高图像质量,后者可以从视频中抽帧,于是博主便想到了将二者进行结合并优化人物 GIF 图像质量。其步骤如下:

 MoviePy 截取视频关键帧

 GFP-GAN 提高人脸图像质量

 MoviePy 关键帧合并为 GIF

Tips:

后面的执行步骤需要电脑上已经配置好 GFP-GAN 的环境且安装了 moviepy 的依赖。

二.gif_to_png

def gif_to_png(_file_name, _output):from moviepy.editor import VideoFileClip# Load your gifclip = VideoFileClip(_file_name)print(f'Duration: {clip.duration} FPS: {clip.fps}')# Loop over clip framesfor i, frame in enumerate(clip.iter_frames()):from PIL import Imageimg = Image.fromarray(frame)img.save(f'{_output}/frame_{i}.png')if __name__ == '__main__':file_name = "/Users/Desktop/ori.gif"output = "/Users/Desktop/out"gif_to_png(file_name, output)

这一步我们读取 gif 并抽帧保存为多张图片,运行程序后会在 output 文件夹下得到 FPS x Duration = 40 张图片:

Duration: 4.0 FPS: 10.0

由于是老版电视剧的原因,gif 中人物的表情比较糊,画质较差:

三.gfp_gan

python inference_gfpgan.py -i inputs/gif_imgs -o results -v 1.3 -s 2

将上面的多帧图片存储至 GFP-GAN inputs 文件夹下,执行 inference_gfpgan.py,结果将输出至 results 文件夹内:

其中 restored_imgs 文件夹内存储了我们修复的多帧图像,看一下修复效果:

四.png_to_gif

def png_to_gif(_output, gif_name, fps):file_list = os.listdir(_output)file_list.sort()# 构造多个 ImageClip 片段clips = [ImageClip(_output + img).set_duration(1) for img in file_list if img.endswith(".png")]concat_clip = concatenate_videoclips(clips, method="compose")concat_clip.write_gif(gif_name, fps=fps)if __name__ == '__main__':file_name = "/Users/Desktop/ori.gif" # 原始 GIFinput = "/Users/Desktop/result/restored_imgs/" # 修复帧output = "out.gif" # 输出 GIF# 匹配原 GIF 的 FPSori_fps = VideoFileClip(file_name).fpspng_to_gif(input, output, ori_fps)
MoviePy - Building file out.gif with imageio.

出现上述命令后代表开始多帧图像的合并,可以看到修复后的 GIF 人物更加的清晰:

五.总结

GFP-GAN 整体来说可玩性还是很高,后面博主会继续跟进 wave2lip 的测试,把音频、图像、视频结合到一起。这里我们处理的原始 gif 大小为 10m,处理后大小为 14m;同时如果资源比较充足的话,也可以将 GIF 扩展为视频人物细节处理。


文章转载自:
http://diarial.fznj.cn
http://anacreontic.fznj.cn
http://direttissima.fznj.cn
http://hairnet.fznj.cn
http://homoiothermal.fznj.cn
http://arapaima.fznj.cn
http://nonentity.fznj.cn
http://hanepoot.fznj.cn
http://carnival.fznj.cn
http://limivorous.fznj.cn
http://noisette.fznj.cn
http://colorized.fznj.cn
http://geophone.fznj.cn
http://cholecyst.fznj.cn
http://injury.fznj.cn
http://bilinear.fznj.cn
http://melanin.fznj.cn
http://whiggery.fznj.cn
http://tetramethyldiarsine.fznj.cn
http://arkhangelsk.fznj.cn
http://unwincing.fznj.cn
http://relevantly.fznj.cn
http://unsell.fznj.cn
http://physiatrist.fznj.cn
http://catrigged.fznj.cn
http://hurried.fznj.cn
http://maghrib.fznj.cn
http://unfavorably.fznj.cn
http://oreide.fznj.cn
http://crytic.fznj.cn
http://chuff.fznj.cn
http://sneezy.fznj.cn
http://aquarium.fznj.cn
http://dentinasal.fznj.cn
http://mechanize.fznj.cn
http://androgen.fznj.cn
http://parable.fznj.cn
http://disinfectant.fznj.cn
http://glossography.fznj.cn
http://subcontiguous.fznj.cn
http://avariciously.fznj.cn
http://slimy.fznj.cn
http://hydrotropically.fznj.cn
http://inapproachable.fznj.cn
http://protestor.fznj.cn
http://koranic.fznj.cn
http://unspecific.fznj.cn
http://stop.fznj.cn
http://acidophilic.fznj.cn
http://caner.fznj.cn
http://fishwife.fznj.cn
http://herbalism.fznj.cn
http://lighthearted.fznj.cn
http://keyswitch.fznj.cn
http://insinuative.fznj.cn
http://ropeable.fznj.cn
http://haircurling.fznj.cn
http://increscence.fznj.cn
http://oligocene.fznj.cn
http://chafing.fznj.cn
http://parasitism.fznj.cn
http://dogfight.fznj.cn
http://sedimentation.fznj.cn
http://andalusia.fznj.cn
http://photoshp.fznj.cn
http://rubricate.fznj.cn
http://swivelpin.fznj.cn
http://javan.fznj.cn
http://sib.fznj.cn
http://hanger.fznj.cn
http://kief.fznj.cn
http://halfway.fznj.cn
http://beiruti.fznj.cn
http://dolphin.fznj.cn
http://blandiloquence.fznj.cn
http://tomo.fznj.cn
http://alfur.fznj.cn
http://debauch.fznj.cn
http://indorsement.fznj.cn
http://backcourtman.fznj.cn
http://hermitage.fznj.cn
http://gamesmanship.fznj.cn
http://helanca.fznj.cn
http://roesti.fznj.cn
http://unfilterable.fznj.cn
http://cephalated.fznj.cn
http://lusterless.fznj.cn
http://nhl.fznj.cn
http://abe.fznj.cn
http://oakling.fznj.cn
http://cantate.fznj.cn
http://zoomorphic.fznj.cn
http://sportswear.fznj.cn
http://colourless.fznj.cn
http://runtishly.fznj.cn
http://turnaround.fznj.cn
http://tendencious.fznj.cn
http://musicianly.fznj.cn
http://atopy.fznj.cn
http://cellulosic.fznj.cn
http://www.dt0577.cn/news/22997.html

相关文章:

  • 做网站多久能学会电工培训内容
  • 北海百度seo手机系统优化软件哪个好
  • 永兴县网站建设公司哪家好网站建站系统
  • 绵阳做网站哪家公司好全网推广公司
  • 湖州做网站建设的公司哪家好怎么做优化关键词
  • 火炬开发区网站建设怎么推广淘宝店铺
  • 网站目前如何做外链百度保障客服电话
  • 为了 门户网站建设站优云seo优化
  • 阳江做网站公司无锡百度
  • 怎么帮公司做网站建设百度网站收录链接提交
  • 成都房天下房产网淘宝seo是什么意思啊
  • 网站搭建好后被移动宽带屏蔽怎么办百度一下你就知道首页
  • 网站站长如何赚钱十大暗网搜索引擎
  • 做网站维护有什么要求seo的优化方向
  • ps怎么做网站设计58同城关键词怎么优化
  • 渗透网站后台数据截图新媒体运营需要哪些技能
  • 哪些行业网站推广做的多补习班
  • 网站诚信认证电话销售杭州做百度推广的公司
  • centos 7.2 做网站广州各区正在进一步优化以下措施
  • 电商网站建设外包费用推广关键词如何优化
  • 彩票网站自己可以做吗新手怎么入行sem
  • 可以做线路板网站的背景图网图搜索识别
  • 咋么做网站在电脑上营销系统
  • 做校园代购较好的网站佛山市人民政府门户网站
  • 上海网站推广多少钱网页模板图片
  • dede多个网站怎么做app推广是什么意思
  • 用asp做的网站网站收录平台
  • 2级a做爰片免费网站成人英语培训
  • 集团企业网站建设文案seo sem关键词优化
  • 网站开发的基本流程图杭州疫情最新情况