代码拉取完成,页面将自动刷新
#!/usr/bin/env python3
import cv2
import depthai as dai
def printSystemInformation(info):
m = 1024 * 1024 # MiB
print(f"Ddr used / total - {info.ddrMemoryUsage.used / m:.2f} / {info.ddrMemoryUsage.total / m:.2f} MiB")
print(f"Cmx used / total - {info.cmxMemoryUsage.used / m:.2f} / {info.cmxMemoryUsage.total / m:.2f} MiB")
print(f"LeonCss heap used / total - {info.leonCssMemoryUsage.used / m:.2f} / {info.leonCssMemoryUsage.total / m:.2f} MiB")
print(f"LeonMss heap used / total - {info.leonMssMemoryUsage.used / m:.2f} / {info.leonMssMemoryUsage.total / m:.2f} MiB")
t = info.chipTemperature
print(f"Chip temperature - average: {t.average:.2f}, css: {t.css:.2f}, mss: {t.mss:.2f}, upa: {t.upa:.2f}, dss: {t.dss:.2f}")
print(f"Cpu usage - Leon CSS: {info.leonCssCpuUsage.average * 100:.2f}%, Leon MSS: {info.leonMssCpuUsage.average * 100:.2f} %")
print("----------------------------------------")
# Create pipeline
pipeline = dai.Pipeline()
# Define source and output
sysLog = pipeline.create(dai.node.SystemLogger)
linkOut = pipeline.create(dai.node.XLinkOut)
linkOut.setStreamName("sysinfo")
# Properties
sysLog.setRate(1) # 1 Hz
# Linking
sysLog.out.link(linkOut.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
# Output queue will be used to get the system info
qSysInfo = device.getOutputQueue(name="sysinfo", maxSize=4, blocking=False)
while True:
sysInfo = qSysInfo.get() # Blocking call, will wait until a new data has arrived
printSystemInformation(sysInfo)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。