https://github.com/ksm26/video-analysis-agent
https://github.com/ksm26/video-analysis-agent
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ksm26/video-analysis-agent
- Owner: ksm26
- Created: 2025-06-29T11:39:49.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T17:35:33.000Z (3 months ago)
- Last Synced: 2025-06-29T18:28:08.377Z (3 months ago)
- Language: Python
- Size: 1.01 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π₯ Hercules Video Analysis Agent
## π Project Overview
This project implements an automated Video Analysis Agent for Hercules test runs.
The agent evaluates whether the test run was executed as planned by comparing:
β The agent's Planning Log (thoughts/steps)
β Video recording(s) of the run
β The final test output**Deviation reports** are generated indicating if any claimed action was skipped, altered, or missing in the video evidence.
---
## βοΈ Features
- Modular, scalable Python codebase
- Step-by-step video inspection with YOLOv8-based action detection
- Final test output validation
- Lightweight AI assistance using `flan-t5-small` (runs on low-resource machines)
- Generates `.txt` and `.html` deviation reports
- Fully configurable via `configs/settings.py`---
## ποΈ Project Structure
video_analysis_agent/
βββ agent\
βΒ Β βββ base_agent.py\
βββ config\
βΒ Β βββ __init__.py\
βΒ Β βββ settings.py\
βββ data\
βΒ Β βββ planning_logs\
βΒ Β βΒ Β βββ run1.txt\
βΒ Β βββ test_outputs\
βΒ Β βΒ Β βββ run1_output.txt\
βΒ Β βββ videos\
βΒ Β βββ run1.mp4\
βββ models\
βΒ Β βββ yolov8s.pt\
βββ reports\
βββ requirements.txt\
βββ run_agent.py\
βββ run_agent_langchain.py\
βββ src\
βΒ Β βββ deviation_engine.py\
βΒ Β βββ __init__.py\
βΒ Β βββ input_handler.py\
βΒ Β βββ output_checker.py\
βΒ Β βββ planning_parser.py\
βΒ Β βββ report_generator.py\
βΒ Β βββ video_analyzer.py\
βββ tools\
βΒ Β βββ ai_tools.py\
β βββ __init__.py---
## π How to Run the Agent### 1οΈβ£ Setup
Install requirements:
```bash
pip install -r requirements.txt
```### 2οΈβ£ Place Input Files
Videos β `data/videos/`Planning Logs (`.txt`) β `data/planning_logs/`
Final Output Files β `data/test_outputs/`
Ensure filenames align (e.g., `run1.mp4`, `run1.txt`, `run1_output.txt`).
### 3οΈβ£ Run the Agent
```bash
python run_agent.py
```Reports are generated in `reports/` with timestamps.
Example:
`reports/run1_detailed_report_20240628_153020.txt` \
`reports/run1_detailed_report_20240628_153020.html`### π Outlines
`Video β Frames β YOLO Detections β AI Agent` \
` AI Agent: `\
` - Uses LLM to parse Planning Log (extract steps)` \
` - Matches steps to YOLO results (Was action observed?) `\
` - Flags deviations or missing actions` \
` - Generates final report with reasoning`### π Sample Output
```bash
Test Report Details
Test Suite: run1
==================================================
Total Duration: 87.63 sec
Total Token Used: 43
Total Cost Estimate: 9e-05 USDTest Result Summary
--------------------------------------------------
Steps Passed: 0
Steps Failed: 3Detailed Steps:
--------------------------------------------------
Step 1: ο»ΏClick "Login"
Result: β Deviation
Notes: Action not found in videoStep 2: Enter Password
Result: β Deviation
Notes: Action not found in videoStep 3: Submit Form
Result: β Deviation
Notes: Action not found in videoOutput File: data/test_outputs/run1_output.txt
Proofs Video: data/videos/run1.mp4
Planner Thoughts Log: ./log_files/run1_planner_thoughts.log
Chat Messages Log: ./log_files/run1_chat_messages.log
```### π Requirements
- Python 3.8+
- Tested with flan-t5-small for AI tasks
- Uses YOLOv8 for action detection
- Low hardware requirements (8GB RAM compatible)### π References
- [Hercules GitHub](https://github.com/test-zeus-ai/testzeus-hercules)