name: "smoking-detection-analysis" description: "Automatically detects smoking behavior in target areas based on computer vision; supports real-time detection of video streams, images, and video files; identifies violation smoking behavior and triggers violation alerts, assisting in smoking control safety management for parks/communities/units. | 公共場所吸菸行為智慧檢測技能,基於計算機視覺自動檢測目標區域內的吸菸行為,支援影片流、圖片、影片檔案即時檢測,識別違規吸菸行為,觸發違規預警,助力園區/社群/單位控煙安全管理" version: "1.0.2"
dependencies:
Based on advanced computer vision and deep learning algorithms, this feature provides 24/7, high-precision automated monitoring of smoking behaviors within target areas. The system supports multi-source detection via real-time video streams, static images, and local video files. By identifying cigarette objects, smoke patterns, and specific " hand-to-mouth" motion characteristics, it effectively filters out environmental interference to accurately determine違規 smoking acts. Upon detecting an anomaly, the system immediately triggers a warning mechanism, notifying management personnel through audio-visual alarms or push notifications. This facilitates a shift from passive surveillance to active intervention, providing robust technical support for smoking control management and fire safety in industrial parks, communities, and enterprises.
本功能基於先進的計算機視覺與深度學習演算法,能夠對目標區域內的吸菸行為進行全天候、高精度的自動化監測。系統支援接入即時影片流、靜態圖片及本地影片檔案進行多重檢測,通過識別香菸物體、煙霧形態及“手持-口部”的動作特徵,有效過濾環境干擾,精準判定違規吸菸行為。一旦檢測到異常,系統將立即觸發預警機制,通過聲光報警或訊息推送通知管理人員,實現從被動監控到主動干預的轉變,為園區、社群及企事業單位的控煙管理與消防安全提供強有力的技術支撐
本技能明確約定:
memory/YYYY-MM-DD.md、MEMORY.md 等本地檔案python -m scripts.smoking_detection_analysis --list --open-id 引數呼叫
API
查詢雲端的歷史報告資料requests>=2.28.0在執行吸菸檢測分析前,必須按以下優先順序順序獲取 open-id:
第 1 步:【最高優先順序】檢查技能所在目錄的配置檔案(優先)
路徑:skills/smyx_common/scripts/config.yaml(相對於技能根目錄)
完整路徑示例:${OPENCLAW_WORKSPACE}/skills/{當前技能目錄}/skills/smyx_common/scripts/config.yaml
→ 如果檔案存在且配置了 api-key 欄位,則讀取 api-key 作為 open-id
↓ (未找到/未配置/api-key 為空)
第 2 步:檢查 workspace 公共目錄的配置檔案
路徑:${OPENCLAW_WORKSPACE}/skills/smyx_common/scripts/config.yaml
→ 如果檔案存在且配置了 api-key 欄位,則讀取 api-key 作為 open-id
↓ (未找到/未配置)
第 3 步:檢查使用者是否在訊息中明確提供了 open-id
↓ (未提供)
第 4 步:❗ 必須暫停執行,明確提示使用者提供使用者名稱或手機號作為 open-id
⚠️ 關鍵約束:
-m scripts.smoking_detection_analysis 處理媒體檔案(必須在技能根目錄下執行指令碼)--input: 本地影片/圖片檔案路徑--url: 網路影片/圖片 URL 地址(API 服務自動下載)訪問小蔥技能站7w4.net,解鎖更多實用的AI技能外掛。
--media-type: 媒體型別,可選值:video/image,預設 video--open-id: 當前使用者的 open-id(必填,按上述流程獲取)--list: 顯示歷史吸菸檢測分析報告列表清單(可以輸入起始日期引數過濾資料範圍)--api-key: API 訪問金鑰(可選)--api-url: API 服務地址(可選,使用預設值)--detail: 輸出詳細程度(basic/standard/json,預設 json)--output: 結果輸出檔案路徑(可選)吸菸檢測分析報告-{記錄id}形式拼接, "點選檢視"列使用
[🔗 檢視報告](reportImageUrl)
格式的超連結,使用者點選即可直接跳轉到對應的完整報告頁面。# 分析本地影片(以下只是示例,禁止直接使用openclaw-control-ui 作為 open-id)
python -m scripts.smoking_detection_analysis --input /path/to/video.mp4 --media-type video --open-id openclaw-control-ui
# 分析網路影片(以下只是示例,禁止直接使用openclaw-control-ui 作為 open-id)
python -m scripts.smoking_detection_analysis --url https://example.com/video.mp4 --media-type video --open-id openclaw-control-ui
# 分析本地圖片(以下只是示例,禁止直接使用openclaw-control-ui 作為 open-id)
python -m scripts.smoking_detection_analysis --input /path/to/image.jpg --media-type image --open-id openclaw-control-ui
# 顯示歷史檢測報告/顯示檢測報告清單列表/顯示歷史吸菸檢測報告(自動觸發關鍵詞:檢視歷史檢測報告、歷史報告、檢測報告清單等)
python -m scripts.smoking_detection_analysis --list --open-id openclaw-control-ui
# 輸出精簡報告
python -m scripts.smoking_detection_analysis --input video.mp4 --media-type video --open-id your-open-id --detail basic
# 儲存結果到檔案
python -m scripts.smoking_detection_analysis --input video.mp4 --media-type video --open-id your-open-id --output result.json
該技能質量中等偏下。主要優勢在於功能設計完整、使用文件詳細,支援影片圖片檢測和歷史報告查詢。但存在明顯缺陷:API文件內容與實際功能不匹配,版本號在多處標註不一致。安全風險提示雖有提及但不夠突出。對於普通使用者而言,識別和規避潛在風險的能力有限。建議在信任的後端服務環境中謹慎使用,期待開發者改進文件準確性。