从图像、视频或类似的图层中合成最终输出。

layered-vision的Python项目详细描述


分层视觉

本项目的目标是:

  • 允许通过配置文件(如虚拟网络摄像头)合成图像或视频的工具。在

这个项目仍处于试验阶段,可能会有重大变化。在

安装

pip install layered-vision

配置

配置格式为file is YAML。在

有很多example configuration files。在

每个配置文件都将包含层。层通常是自上而下描述的。 最后一层通常是输出层。在

输出层的源将是上面的层。在

下载numpy徽标并将其保存到文件中的一个非常简单的配置文件可能如下所示(example-config/save-image.yml):

^{pr2}$

您还可以有两个输出(example-config/two-outputs.yml):

layers:-id:ininput_path:"https://github.com/numpy/numpy/raw/master/branding/logo/logomark/numpylogoicon.png"-id:out1output_path:"data/numpy-logo1.png"-id:out2output_path:"data/numpy-logo2.png"

在这种情况下,out1out2的源层都是in。在

通过使用window作为output_path,图像将显示在一个窗口(example-config/display-image.yml):

layers:-id:ininput_path:"https://github.com/numpy/numpy/raw/master/branding/logo/logomark/numpylogoicon.png"width:480height:300repeat:true-id:outoutput_path:window

输入层

具有input_path属性的层。在

当前支持以下输入:

  • 图像
  • 视频
  • Linux网络摄像头(/dev/videoN

input_path可能指向一个远程位置(与all examples一样)。在这种情况下,它将被下载并在本地缓存。在

过滤层

{cda}具有^属性的层。在

当前支持以下筛选器:

namedescription
^{}Blurs the image or channel.
^{}Uses the bodypix model to mask a person.
^{}Uses a chroma key (colour) to add a mask
^{}Copies the input. Mainly useful as a placeholder layer with ^{}.
^{}Dilates the image or channel. For example to increase the alpha mask after using ^{}
^{}Erodes the image or channel. That could be useful to remove outliers from an alpha mask.
^{}Adds a motion blur to the image or channel. That could be used to make an alpha mask move more slowly
^{}Pixelates the input.

每个filter都可能有其他属性。请参考examples(或以后再来)了解更多详细信息。在

分支层

具有branches属性的层。 每个branch都需要有一个layers属性。 每组branch layers的输入是对branchs层的输入。 然后将分支合并(在彼此之上添加)。 要使branches有用,至少最后一个branch image应该有一个alpha掩码。在

命令行接口

CLI帮助

python -m layered_vision --help

或者

python -m layered_vision <sub command> --help

示例命令

python -m layered_vision start --config-file=example-config/display-image.yml

您还可以从远程位置加载配置:

python -m layered_vision start --config-file \"https://raw.githubusercontent.com/de-code/layered-vision/develop/example-config/display-video-chroma-key-replace-background.yml"

致谢

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java:收藏。最大返回最大数字错误   java Android api29如何在安装时自动在主屏幕上添加应用程序图标?   如何存储到MongoDB数据库中并使用Java从同一MongoDB数据库读取/加载?   java如何在不延迟界面的情况下延迟gui的操作?   Hibernate中空引用的java查询处理   java Hibernate无效的配置映射   用协变类型wrt变量重写java   java JBoss Envers多通审计   swing如何分发JavaGUI构建器项目   链表在Java中如何通过LinkedList搜索具有特定变量的对象?   java如何使用JDBC更新整数?   java Spring DispatchServlet在Jetty中找不到资源   反射如何在Java中跟踪方法结果   java关于接口的一般问题   java如何从xml报告生成cobertura html报告   java组织。springframework。豆。工厂BeanCreationException:无法自动关联字段:私有组织。冬眠会话工厂   java RealmMigration删除了我所在领域的所有数据   在java中将json数据字符串转换为字典数组   java最简单的设置并忘记存储简单JSON结构的分布式数据库?