运动探测器
detection的Python项目详细描述
python检测
运动探测器。目前实现了SimpleDetector
和{
使用BlobDetector
:
import numpy as np
from detection.detectors.blob.detector import BlobDetector
detector = BlobDetector({"blur": 7, "learningrate": 0.001, "accelerate": True})
(_boundingboxes, _metadata) = detector.feed(
np.reshape(np.frombuffer(frame, dtype=np.uint8), newshape=(height, width, 3))
)
如果指定了blur
值,将在将帧送入检测器之前执行。
如果没有给定blur
,则按原样馈送帧。在
描述了learningrate
参数
here。
如果未指定learningrate
,则默认为0.001
。在
accelerate
参数默认为True
,检测器试图利用任何GPU资源
在主机上可用。在
元数据包含有关对输入映像执行的操作的详细信息(按顺序),以及 每一个都花了多长时间:
^{pr2}$边界框包含任何检测到的移动:
{
(
UUID('091c2620-ebb6-4cbe-b59d-42da156c3ba9'),
datetime.datetime(2020, 6, 16, 16, 11, 35, 931755)
): (279, 324, 710, 755),
(
UUID('bcbf2e18-ed2b-4e68-b94c-abe021071e61'),
datetime.datetime(2020, 6, 16, 16, 11, 35, 931755)
): (489, 324, 920, 755)
}
uuid是为了提供与假设的新检测器的前向兼容性 同时跟踪运动。在
发展
TLDR:
创建并激活Python 3.7 virtualenv:
$ python3.7 -m venv .venv && . .venv/bin/activate
更改为分支:
git checkout -b my_branch
安装诗歌:https://python-poetry.org/docs/#installation
安装项目DEP和预提交挂钩:
poetry install
pre-commit install
pre-commit run --all-files
准备出发了。在
记住,无论何时处理回购,都要激活virtualenv,这是必需的 因为pylint和mypy pre-commit钩子现在使用的是“系统”python(因为原因)。在
- 项目
标签: