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

正规html5网站wordpress手动更新视频教程

正规html5网站,wordpress手动更新视频教程,网站服务器中如何做重定向,php做网站用什么软件老照片常常因为当时的技术限制而只有黑白版本。然而现代的 AI 技术#xff0c;如 DeOldify#xff0c;可以让这些照片重现色彩。 本教程将详细介绍如何使用 DeOldify 来给老照片上色。 文章目录 准备工作执行代码图片上色视频上色 总结 准备工作 这里用 git clone 命令克隆…老照片常常因为当时的技术限制而只有黑白版本。然而现代的 AI 技术如 DeOldify可以让这些照片重现色彩。 本教程将详细介绍如何使用 DeOldify 来给老照片上色。 文章目录 准备工作执行代码图片上色视频上色 总结 准备工作 这里用 git clone 命令克隆了 DeOldify 的 GitHub 仓库然后安装了所需的依赖库。 git clone https://github.com/jantic/DeOldify.git常规的需要创建和激活虚拟环境并安装相关依赖包。 conda create --name python38 python3.8 conda activate python38 pip install -r requirements.txt然后会可能会提示 ERROR: pips dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. onnxruntime 1.14.1 requires flatbuffers, which is not installed. onnxruntime 1.14.1 requires sympy, which is not installed. 这里还需要安装flatbuffers和sympy。 pip install flatbuffers sympy安装完成之后你的文件目录是这样的然后将虚拟环境目录移动到当前目录下。 接下来需要下载模型文件。 下载地址在 https://huggingface.co/spensercai/DeOldify/tree/main 。 将下载好的文件移动到models文件夹下即可。 执行代码 图片上色 导入依赖库包括DeOldify库、matplotlib.pyplot、torch等。这些库用于图像处理、可视化以及深度学习任务。设置设备使用DeOldify库的device.set()函数将计算设备设置为GPU0。这意味着后续的图像处理任务将在GPU上进行加速处理如果有多个GPU可用可以根据需要进行选择。设置图像风格使用plt.style.use(dark_background)设置了Matplotlib图形的风格使其采用黑色背景。禁用警告使用warnings.filterwarnings()函数来忽略特定类型的警告这里忽略了UserWarning类型的警告消息。创建着色器使用get_image_colorizer(artisticTrue)创建了一个图像着色器对象其中artisticTrue表示使用艺术化的着色方式。设置参数 render_factor定义了渲染因子影响着色的细节程度。source_url和source_path分别指定了输入图像的URL和本地路径。result_path用于存储着色后的图像的路径初始设置为None。 图像着色 代码根据source_url是否为空选择不同的方式来进行图像着色。如果source_url不为空将从URL加载图像并进行着色否则从本地路径加载图像进行着色。着色后的结果将存储在result_path中。 # env setup.py/py # -*- coding: UTF-8 -*-Project setup.py File porcess_img.py IDE PyCharm Author Mr数据杨 Date 2023/10/11 12:43 from deoldify import device from deoldify.device_id import DeviceId# choices: CPU, GPU0...GPU7 device.set(deviceDeviceId.GPU0)from deoldify.visualize import *plt.style.use(dark_background) torch.backends.cudnn.benchmark True import warningswarnings.filterwarnings(ignore, categoryUserWarning, message.*?Your .*? set is empty.*?)colorizer get_image_colorizer(artisticTrue)render_factor 35 source_url None source_path data/img.jpg result_path Noneif source_url is not None:result_path colorizer.plot_transformed_image_from_url(urlsource_url, pathsource_path, render_factorrender_factor, compareTrue) else:result_path colorizer.plot_transformed_image(pathsource_path, render_factorrender_factor, compareTrue)show_image_in_notebook(result_path)最后会在result_images文件夹下生成结果图片。 视频上色 执行代码之前需要在项目目录下创建video文件夹并在文件夹下创建source文件夹。 这里执行的代码不再解释理论上和上面图片的差不多就是处理的时候先将视频转帧然后依次上色最后再合并在一起保存成视频。 # env setup.py/py # -*- coding: UTF-8 -*-Project setup.py File porcess_img.py IDE PyCharm Author Mr数据杨 Date 2023/10/11 12:43 from deoldify import device from deoldify.device_id import DeviceId# choices: CPU, GPU0...GPU7 device.set(deviceDeviceId.GPU0)from deoldify.visualize import *plt.style.use(dark_background) import warningswarnings.filterwarnings(ignore, categoryUserWarning, message.*?Your .*? set is empty.*?)colorizer get_video_colorizer()render_factor 21# source_urlhttps://twitter.com/silentmoviegifs/status/1116751583386034176 source_url None file_name video file_name_ext file_name .mp4 result_path Noneif source_url is not None:result_path colorizer.colorize_from_url(source_url, file_name_ext, render_factorrender_factor) else:result_path colorizer.colorize_from_file_name(file_name_ext, render_factorrender_factor)show_video_in_notebook(result_path)总结 DeOldify 不仅能够给老照片上色还能用于其他许多有趣的应用如老电影修复等。希望这个简单的教程能帮助读者更容易地掌握这一技术。 如果想使用Stable Diffusion进行操作的话可以参考 Stable diffusion 用DeOldify给黑白照片、视频上色。
http://www.dnsts.com.cn/news/233601.html

相关文章:

  • 网站开发 英语品牌营销策划ppt
  • 网站怎么制作视频教程app开发和网站开发价格
  • 手工做刀网站怎么设计自己logo
  • 什么网站详情页做的好网络货运平台有哪些
  • 想开个网站怎么做站长源码论坛
  • wordpress站点前台请求数过多网站怎么做语言切换
  • 海丰县建设局官方网站东莞招聘信息
  • 网站制作上哪学校美图在线图片编辑器
  • 如何设置网站公司动态网站建设网站营销
  • 工信部网站黑名单查询没网站域名可以做备案吗
  • 做推文封面的网站有用模板网在线制作免费网站
  • 做网站需要提供些什么页面html电影网站模板下载
  • 那个外贸网站做的最好网站建设开发能力很强的企业
  • 怎样免费建设个人网站以下哪个单词表示搜索引擎优化
  • 建设银行在网站上开通短信提醒做网站需要用什么系统
  • 网站做虚假宣传有没有做处罚移动网站建设作业
  • 网站制作的主要技术北京的网站设计公司
  • 企业为什么需要手机网站系统开发工程师是干什么的
  • 网站用户告知书广东网站建设智搜宝
  • 做网站的软件著作权学校文化建设的网站
  • 新网站建设需要注意wordpress输入xml
  • 创建网站要申请域名吗如何在网站添加代码
  • 网站建设技术开发不付费免费网站
  • 桂林广告公司网站建设网站开发厦门
  • 查网站是否正规wordpress段子主题
  • 网站建设基本要求百度推广 帮做网站吗
  • 电子商务网站业务流程别人用我公司权限做网站
  • 深圳入户申请网站官网机械加工网站模板
  • 网站建设技术外包golang 网站开发 教程
  • 做网站服务器电脑配置安徽省城乡建设厅网站