跳到正文
DEV Community· x549d·· 14 天前AI 評分43

如何用 cascade-vision 和 Python 偵測影片物件並匯出活動記錄

Detect Objects in Video and Export Activity Records with Python

AI 導讀

cascade-vision 是開源 Python 程式庫及 CLI,可偵測影片中的物件、選取區域供視覺語言模型分析,並匯出結構化活動記錄。處理流程結合 OpenCV 動態篩選、YOLO 偵測、ByteTrack 追蹤及背景語義分析。專案仍處於 early alpha,實際準確度和成本節省尚待驗證;示範使用合成影格及模擬描述,不代表辨識準確度。

正文

x549d

Introduction
cascade-vision is an open-source Python library and CLI that detects objects in video, selects regions for vision-language model analysis, and exports structured activity records.

It supports video files, webcams and RTSP streams. The project is early alpha; real-world accuracy and cost savings remain to be validated.cascade-vision

What Does It Do?
The pipeline combines OpenCV motion filtering, YOLO detection, ByteTrack tracking and background semantic analysis.

Its output can help you:

  • Locate selected observations in the original video.
  • Filter records by object category or event label.
  • Feed descriptions into your own database or dashboard.
  • Compare sampling policies using recall, latency and API usage. How to Try It With Python 3.9 or newer:
git clone https://github.com/x549d/cascade-vision.git
cd cascade-vision
python -m pip install -e .

python -m cascade_vision.cli demo --mock-vlm \
  --event-labels person,backpack \
  --report-json reports/demo.json \
  --events-jsonl reports/events.jsonl

The demo generates synthetic frames and mock descriptions. After installation, it needs no footage, camera or API key and sends no paid API requests.

Real video detection requires the optional YOLO dependencies. Real semantic analysis requires a configured model API and may incur charges.
How to Use the Results

  • demo.json summarizes processed frames, task outcomes, usage and timing.
  • events.jsonl contains individual observations with time information, categories, activity descriptions and event labels. Use these records to build a review list, filter relevant observations or connect another application. Demo records contain simulated: true; they demonstrate the format, not recognition accuracy.

I’d welcome feedback on installation and whether the output fits your video-analysis workflow.

來源:DEV Community · dev.to