Automated evaluation of cooking action classification performance
This directory contains tools for automatically running Viam servers, capturing logs, and analyzing action classification performance.
- ✅ viam-server installed and in PATH
- ✅ Valid Viam configuration file with credentials
- ✅ replayCamera-1 component configured in your Viam machine
- ✅ Video file path set in the Viam dashboard
# Navigate to evaluation directory
cd evaluation/
# Run with default settings (recommended)
python automate_evaluation.py
# Or with custom options
python automate_evaluation.py \
--config /path/to/viam-config.json \
--output-dir my_results \
--timeout 15- Go to your Viam machine configuration
- Find the
replayCamera-1component - Update the
video_pathattribute to your target video file:{ "name": "replayCamera-1", "api": "rdk:component:camera", "model": "bill:camera:video-replay", "attributes": { "mode": "local", "fps": 2, "loop_video": false, "video_path": "/full/path/to/your/video.mp4" } } - Save the configuration
python automate_evaluation.pyThe script will:
- 🚀 Start viam-server using your configuration
- 📺 Monitor logs for end-of-file signal
- 🎬 Detect completion when video finishes
- 🔍 Run analysis using
extract_and_align_classifier.py - 📊 Generate reports and save results
Results are saved in evaluation_results/ directory:
evaluation_results/
├── viam_server_20240612_143022.log # Raw server logs
├── viam_server_20240612_143022.analysis.txt # Processed analysis
├── viam_server_20240612_143022_timeline.log # Classification timeline
└── evaluation_results_20240612_143022.json # Complete results| Option | Default | Description |
|---|---|---|
--config |
/Users/marcuslam/Desktop/Gambit/viam-marcus-dev-main.json |
Path to Viam configuration file |
--output-dir |
evaluation_results |
Output directory for results |
--timeout |
10 |
Timeout in minutes per session |
🎯 Starting Simplified Evaluation Pipeline
============================================================
📁 Output directory: evaluation_results
⚙️ Viam config: /path/to/config.json
📋 Make sure your video is configured in the Viam dashboard
🚀 Starting viam-server
⏱️ Timeout: 10 minutes
📺 Monitoring logs for end-of-file signal...
📝 Logs being written to: evaluation_results/viam_server_20240612_143022.log
🎬 Video playback completed!
✅ Log capture complete: evaluation_results/viam_server_20240612_143022.log
🔍 Running analysis for: current_session
✅ Analysis completed successfully
📄 Analysis saved to: evaluation_results/viam_server_20240612_143022.analysis.txt
✅ Successfully processed session
📊 Generating Summary Report
============================================================
🎯 Total detections: 12
✅ Accepted: 8
❌ Rejected: 4
📈 Acceptance rate: 66.7%
🎯 Average confidence: 85.3%
📊 Average similarity: 78.2%
⚡ Average analysis time: 2.1s
🎉 Evaluation Pipeline Complete!
📊 Results saved to: evaluation_results.analysis.txt - Human-readable analysis with:
- Detection summaries
- Action breakdowns
- Performance metrics
- Recommendations
_timeline.log - Detailed classification timeline with:
- Raw log blocks for each detection
- Motion detection details
- Claude analysis responses
- Acceptance/rejection decisions
.json - Machine-readable results for integration
To evaluate multiple videos:
- Configure first video in Viam dashboard
- Run automation script
- Review results
- Configure next video in dashboard
- Repeat - each run creates separate result files
| Problem | Solution |
|---|---|
viam-server not found |
Install viam-server and add to PATH |
Config file not found |
Check path with --config option |
Video doesn't start |
Verify video path is correct in Viam dashboard |
Analysis fails |
Check that extract_and_align_classifier.py exists |
Timeout reached |
Increase timeout with --timeout option |
- Check server logs - Look at the raw
.logfile for errors - Verify video path - Ensure the video file exists and is accessible
- Test viam-server manually - Run
viam-server -config your-config.json - Check Viam dashboard - Ensure your machine configuration is valid
automate_evaluation.py- Main automation scriptextract_and_align_classifier.py- Log analysis and classification extractionsetup_automation.py- Environment validation (optional)
graph TD
A[Start Script] --> B[Load Viam Config]
B --> C[Start viam-server]
C --> D[Monitor Logs]
D --> E{Video Finished?}
E -->|Yes| F[Stop Server]
E -->|No| G{Timeout?}
G -->|Yes| F
G -->|No| D
F --> H[Run Analysis]
H --> I[Generate Reports]
I --> J[Save Results]
- Use consistent video format - MP4 works best
- Set appropriate FPS - 2 FPS is usually optimal
- Disable video looping - Set
loop_video: false - Allow full completion - Let videos play to end for accurate analysis
- Check logs regularly - Monitor for any error patterns
💡 Pro Tip: Keep a spreadsheet tracking which videos you've evaluated and their results for easy comparison across different videos or model versions!