Prerequisites
Before running benchmarks, ensure you have:Dataset Download
Download the UBFC-RPPG Dataset 2 from the official sourceExtract to a local directory (e.g.,
/path/to/dataset_2)Complete Benchmark
The complete benchmark (advance_run_complete.py) provides comprehensive end-to-end metrics including ROI detection, EVM processing, accuracy, and system resources.
Configuration
Opensource/Python/experiments/advance_run_complete.py and configure:
Running the Benchmark
Run the complete benchmark
- Process all 42 subjects in the dataset
- Display progress for each video
- Save results to
results/complete_benchmark_{model}_{timestamp}.json
Example for Different Detectors
Expected Output
The complete benchmark generates a JSON file with:Results Location
Results are saved to:source/Python/results/complete_benchmark_{model}_{timestamp}.json
complete_benchmark_mediapipe_20251206_214658.jsoncomplete_benchmark_yolo_yolov11n_20251206_215432.json
ROI-Only Benchmark
The ROI benchmark (advance_run_ROI.py) focuses exclusively on face detection performance.
Configuration
Running
Use Cases
- Model Selection: Compare detection speeds across all four detector types
- Stability Analysis: Evaluate ROI jitter and size variance
- Reliability Testing: Measure detection rates and failure patterns
- Hardware Validation: Test detector performance on target hardware
Key Metrics
The ROI benchmark provides:- Average detection time per frame
- Detection FPS
- Detection success rate
- ROI spatial jitter
- ROI size variance
- Consecutive failure statistics
EVM-Only Benchmark
The EVM benchmark (advance_run_EVM.py) isolates EVM processing performance and heart rate accuracy.
Configuration
Running
Use Cases
- Buffer Size Optimization: Test different buffer sizes (100, 150, 200, 250)
- EVM Performance: Measure pure processing overhead
- Accuracy Testing: Evaluate HR prediction quality
- Ground Truth Validation: Verify accuracy against pulse oximeter data
Buffer Size Impact
Testing different buffer sizes:Buffer Size: 100 frames
Buffer Size: 100 frames
- Faster response time (3.3 seconds at 30 FPS)
- Lower accuracy due to less data
- More frequent processing
Buffer Size: 200 frames (Recommended)
Buffer Size: 200 frames (Recommended)
- Balanced accuracy and latency (6.7 seconds)
- Good frequency resolution
- Standard configuration
Buffer Size: 250+ frames
Buffer Size: 250+ frames
- Higher accuracy potential
- Increased latency (8.3+ seconds)
- Higher memory usage
Understanding Results
Aggregate Statistics
The benchmark calculates aggregate statistics across all subjects:- Mean: Average performance across all videos
- Std: Standard deviation (variability)
- Median: Middle value (robust to outliers)
- Min/Max: Best and worst case performance
Individual Results
Each subject’s results include:Performance Comparison
Typical results on different hardware:Desktop PC
MediaPipe:
- ROI Detection: 206 FPS
- End-to-End: 124 FPS
- MAE: 13.3 BPM
- CPU: 1.4% average
- Memory: 60%
Raspberry Pi 4
MediaPipe:
- ROI Detection: ~30-50 FPS
- End-to-End: ~15-25 FPS
- MAE: Similar accuracy
- Temperature > 75°C
- CPU throttling
Troubleshooting
Error: Dataset path not found
Error: Dataset path not found
Update
DATASET_PATH in the configuration section to point to your extracted UBFC-RPPG dataset.YOLO model not loading
YOLO model not loading
Ensure you have the YOLO models downloaded. The FaceDetector will download them automatically on first use.
Out of memory errors
Out of memory errors
Reduce
BUFFER_SIZE or process fewer subjects at once. Large buffer sizes (250+) can use significant memory.Slow performance on Raspberry Pi
Slow performance on Raspberry Pi
This is expected. Use Haar Cascade or MediaPipe for best performance. Monitor temperature to avoid throttling.
Next Steps
Understand the Metrics
Learn what each metric means and how to interpret benchmark results