此页面由 AI 自动翻译。查看英文原版
DepthAI
  • DepthAI 组件
    • AprilTags
    • 基准测试
    • Camera
    • 校准
    • DetectionNetwork
    • Events
    • FeatureTracker
    • Gate
    • HostNodes
    • ImageAlign
    • ImageManip
    • IMU
    • 杂项
    • 模型动物园
    • NeuralDepth
    • NeuralNetwork
    • ObjectTracker
    • 点云
    • RecordReplay
    • RGBD
    • Script
    • SpatialDetectionNetwork
    • SpatialLocationCalculator
    • StereoDepth
    • Sync
    • VideoEncoder
    • Visualizer
    • Warp
    • RVC2-specific
      • EdgeDetector
      • NNArchive
      • SystemLogger
      • 热成像
      • Tof
      • VSLAM
  • 高级教程
  • API 参考
  • 工具
软件栈

本页目录

  • 演示
  • 源代码
  • Pipeline

系统信息

Supported on:RVC2
本示例演示了如何从开发板获取系统信息(内存使用率、CPU 使用率和温度)。

演示

示例脚本输出
Command Line
1Ddr used / total - 0.13 / 414.80 MiB
2  Cmx used / total - 2.24 / 2.50 MiB
3  LeonCss heap used / total - 4.17 / 46.41 MiB
4  LeonMss heap used / total - 2.87 / 27.58 MiB
5  Chip temperature - average: 38.59, css: 39.81, mss: 37.71, upa: 38.65, dss: 38.18
6  Cpu usage - Leon CSS: 7.08%, Leon MSS: 1.48 %
7  ----------------------------------------
8  Ddr used / total - 0.13 / 414.80 MiB
9  Cmx used / total - 2.24 / 2.50 MiB
10  LeonCss heap used / total - 4.17 / 46.41 MiB
11  LeonMss heap used / total - 2.87 / 27.58 MiB
12  Chip temperature - average: 38.59, css: 39.58, mss: 37.94, upa: 38.18, dss: 38.65
13  Cpu usage - Leon CSS: 1.55%, Leon MSS: 0.30 %
14  ----------------------------------------
15  Ddr used / total - 0.13 / 414.80 MiB
16  Cmx used / total - 2.24 / 2.50 MiB
17  LeonCss heap used / total - 4.17 / 46.41 MiB
18  LeonMss heap used / total - 2.87 / 27.58 MiB
19  Chip temperature - average: 38.94, css: 40.04, mss: 38.18, upa: 39.35, dss: 38.18
20  Cpu usage - Leon CSS: 0.56%, Leon MSS: 0.06 %
21  ----------------------------------------
22  Ddr used / total - 0.13 / 414.80 MiB
23  Cmx used / total - 2.24 / 2.50 MiB
24  LeonCss heap used / total - 4.17 / 46.41 MiB
25  LeonMss heap used / total - 2.87 / 27.58 MiB
26  Chip temperature - average: 39.46, css: 40.28, mss: 38.88, upa: 39.81, dss: 38.88
27  Cpu usage - Leon CSS: 0.51%, Leon MSS: 0.06 %
28  ----------------------------------------
  • upa 代表 SHAVE 块的温度
  • dss 代表 DDR 子系统的温度
此示例需要 DepthAI v3 API,请参阅 安装说明

源代码

Python

Python
1#!/usr/bin/env python3
2
3import depthai as dai
4
5def printSystemInformation(info: dai.SystemInformation):
6    m = 1024 * 1024 # MiB
7    print(f"Ddr used / total - {info.ddrMemoryUsage.used / m:.2f} / {info.ddrMemoryUsage.total / m:.2f} MiB")
8    print(f"Cmx used / total - {info.cmxMemoryUsage.used / m:.2f} / {info.cmxMemoryUsage.total / m:.2f} MiB")
9    print(f"LeonCss heap used / total - {info.leonCssMemoryUsage.used / m:.2f} / {info.leonCssMemoryUsage.total / m:.2f} MiB")
10    print(f"LeonMss heap used / total - {info.leonMssMemoryUsage.used / m:.2f} / {info.leonMssMemoryUsage.total / m:.2f} MiB")
11    t = info.chipTemperature
12    print(f"Chip temperature - average: {t.average:.2f}, css: {t.css:.2f}, mss: {t.mss:.2f}, upa: {t.upa:.2f}, dss: {t.dss:.2f}")
13    print(f"Cpu usage - Leon CSS: {info.leonCssCpuUsage.average * 100:.2f}%, Leon MSS: {info.leonMssCpuUsage.average * 100:.2f} %")
14    print("----------------------------------------")
15
16# Create pipeline
17pipeline = dai.Pipeline()
18
19# Create system logger node
20sysLog = pipeline.create(dai.node.SystemLogger)
21sysLog.setRate(1)  # 1 Hz
22
23# Create output
24sysLogQueue = sysLog.out.createOutputQueue(maxSize=4, blocking=False)
25
26# Start pipeline
27pipeline.start()
28while pipeline.isRunning():
29    sysInfo = sysLogQueue.get() # Blocking call, will wait until a new data has arrived
30    printSystemInformation(sysInfo)

Pipeline

需要帮助?

请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。