Realtime Estimator Selection Guide
Overview
Choosing the right realtime estimator is crucial for your application's success. This guide helps you make an informed decision based on your specific requirements, constraints, and use cases.
Quick Decision Tree
Detailed Comparison
ME-rPPG Estimator
Best For:
- Consumer fitness and wellness applications
- Challenging lighting or motion conditions
- Applications where AI robustness is valuable
- Projects with open-source requirements
- High-end devices with good connectivity
Choose ME-rPPG if:
- ✅ Users may move slightly during measurement
- ✅ Lighting conditions vary significantly
- ✅ You can download ~10 MB of models
- ✅ Open-source licensing is required
- ✅ You want state-of-the-art AI accuracy
Avoid ME-rPPG if:
- ❌ You need instant initialization
- ❌ Bundle size is critical (< 1 MB)
- ❌ Offline-first is required immediately
- ❌ Target devices have limited memory
- ❌ Slow network connections are common
Panoptic Estimator (Default)
Best For:
- Medical and healthcare applications
- Regulatory compliance requirements
- Resource-constrained environments
- Embedded systems and IoT devices
- Applications requiring instant startup
Choose Panoptic if:
- ✅ Medical-grade accuracy is required
- ✅ You need instant initialization
- ✅ Bundle size must be minimal
- ✅ Offline capability is critical
- ✅ Proprietary IP protection is acceptable
Avoid Panoptic if:
- ❌ Users will be moving significantly
- ❌ Lighting conditions are uncontrolled
- ❌ You need maximum motion tolerance
- ❌ Open-source licensing is required
- ❌ AI-powered features are preferred
Feature Comparison Matrix
| Feature | ME-rPPG | Panoptic | Winner |
|---|---|---|---|
| Accuracy (Ideal Conditions) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | 🤝 Tie |
| Accuracy (Motion) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | 🤖 ME-rPPG |
| Accuracy (Poor Lighting) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | 🤖 ME-rPPG |
| Initialization Speed | ⭐⭐⭐ (1-2s) | ⭐⭐⭐⭐⭐ (instant) | 📈 Panoptic |
| Processing Speed | ⭐⭐⭐⭐ (10-30ms) | ⭐⭐⭐⭐ (5-10ms) | 📈 Panoptic |
| Bundle Size | ⭐⭐⭐ (~10 MB) | ⭐⭐⭐⭐⭐ (~100 KB) | 📈 Panoptic |
| Memory Usage | ⭐⭐⭐ (~4 MB) | ⭐⭐⭐⭐⭐ (<200 KB) | 📈 Panoptic |
| Setup Complexity | ⭐⭐⭐ (models required) | ⭐⭐⭐⭐⭐ (zero config) | 📈 Panoptic |
| Licensing | ⭐⭐⭐⭐⭐ (open-source) | ⭐⭐⭐ (proprietary) | 🤖 ME-rPPG |
| Motion Tolerance | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | 🤖 ME-rPPG |
| Lighting Tolerance | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | 🤖 ME-rPPG |
| First Result | ~3 seconds | ~8 seconds | 🤖 ME-rPPG |
| Optimal Accuracy | ~10 seconds | ~10 seconds | 🤝 Tie |
Use Case Recommendations
Healthcare & Medical Applications
Recommended: Panoptic Estimator
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.Panoptic,
signalQualityDelay: 10, // Longer for medical accuracy
debug: false
}
});Reasons:
- Medical-grade accuracy
- Regulatory compliance friendly
- Deterministic results
- No external dependencies
- Instant initialization
Fitness & Wellness Apps
Recommended: ME-rPPG Estimator
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.MeRppg,
debug: false
}
});Reasons:
- Excellent motion tolerance (users may be active)
- Robust to varying lighting
- Fast initial results
- State-of-the-art AI accuracy
- Open-source licensing
Mobile Apps (iOS/Android)
Recommended: ME-rPPG Estimator
Reasons:
- Users often move devices
- Lighting varies (indoor/outdoor)
- Modern phones have good connectivity
- Memory is generally available
- Users expect AI-powered features
Alternative: Panoptic Estimator (for medical apps or limited connectivity)
Embedded Systems & IoT
Recommended: Panoptic Estimator
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.Panoptic,
debug: false
}
});Reasons:
- Minimal memory footprint
- No model downloads required
- Instant initialization
- Works offline immediately
- Smaller bundle size
Research & Development
Recommended: Both (for comparison)
// Test both estimators
const meRppgCamera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.MeRppg,
debug: true
}
});
const panopticCamera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.Panoptic,
debug: true
}
});Reasons:
- Compare AI vs signal processing approaches
- Analyze different algorithm behaviors
- Understand trade-offs empirically
- Access to signal data from both
Progressive Web Apps (PWA)
Recommended: ME-rPPG Estimator (with Panoptic fallback)
async function createEstimator() {
// Try ME-rPPG first
try {
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.MeRppg,
debug: true
}
});
// Wait for models to load
await new Promise(resolve => setTimeout(resolve, 2000));
return camera;
} catch (error) {
console.warn('ME-rPPG failed, falling back to Panoptic:', error);
// Fallback to Panoptic
return createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.Panoptic,
debug: true
}
});
}
}Performance Comparison
Initialization Time
Processing Performance
| Metric | ME-rPPG | Panoptic |
|---|---|---|
| Frame Processing | 10-30ms | 5-10ms |
| First Result | ~3 seconds | ~5 seconds |
| Optimal Accuracy | ~10 seconds | ~10 seconds |
| CPU Usage | Medium-High | Medium |
| Memory Usage | ~4 MB | <200 KB |
Accuracy Under Different Conditions
| Condition | ME-rPPG | Panoptic |
|---|---|---|
| Ideal (Still, Good Light) | ±2 BPM | ±2 BPM |
| Slight Motion | ±2-3 BPM | ±3-5 BPM |
| Moderate Motion | ±3-5 BPM | ±5-10 BPM |
| Poor Lighting | ±2-4 BPM | ±4-8 BPM |
| Talking | ±3-5 BPM | ±5-10 BPM |
Migration Guide
Switching from Panoptic to ME-rPPG
Step 1: Add Model Files
# Copy ME-rPPG models to public directory
cp -r node_modules/ts-vital-sign-camera/public/models/me-rppg public/models/Step 2: Update Configuration
// Before (Panoptic)
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.Panoptic
}
});
// After (ME-rPPG)
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.MeRppg,
modelPath: 'models/me-rppg/model.onnx',
statePath: 'models/me-rppg/state.json',
welchPath: 'models/me-rppg/welch_psd.onnx',
hrPath: 'models/me-rppg/get_hr.onnx'
}
});Step 3: Handle Async Initialization
// ME-rPPG requires async initialization
camera.on('ready', () => {
console.log('ME-rPPG models loaded and ready');
enableStartButton();
});
camera.on('error', (error) => {
console.error('Failed to load ME-rPPG:', error);
// Fallback to Panoptic or show error
});Switching from ME-rPPG to Panoptic
Step 1: Update Configuration
// Before (ME-rPPG)
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.MeRppg,
modelPath: 'models/me-rppg/model.onnx',
// ... other model paths
}
});
// After (Panoptic)
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: RealtimeEstimatorType.Panoptic
}
});Step 2: Remove Model Files (optional)
# Remove ME-rPPG models to reduce bundle size
rm -rf public/models/me-rppgStep 3: Update User Guidance
// Panoptic is more sensitive to motion
const instructions = [
"Stay completely still", // More important for Panoptic
"Don't talk during measurement", // Critical for Panoptic
"Ensure good, even lighting", // More important for Panoptic
"Wait for full 10 seconds" // Panoptic needs more time
];Runtime Switching
You can switch estimators at runtime by recreating the camera:
let currentEstimator: RealtimeEstimatorType = RealtimeEstimatorType.MeRppg;
let camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: currentEstimator
}
});
function switchEstimator(newType: RealtimeEstimatorType) {
// Clean up current camera
camera.destroy();
// Create new camera with different estimator
currentEstimator = newType;
camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType: currentEstimator
}
});
console.log(`Switched to ${newType} estimator`);
}
// Usage
switchEstimator(RealtimeEstimatorType.Panoptic);Decision Checklist
Use this checklist to make your decision:
Choose ME-rPPG if you answer "Yes" to most
- [ ] Users may move during measurement
- [ ] Lighting conditions are uncontrolled
- [ ] You can download ~10 MB of models
- [ ] Open-source licensing is required
- [ ] You want AI-powered features
- [ ] Target devices are modern (2020+)
- [ ] Network connectivity is good
- [ ] You prioritize accuracy in challenging conditions
Choose Panoptic if you answer "Yes" to most
- [ ] Medical-grade accuracy is required
- [ ] Instant initialization is critical
- [ ] Bundle size must be minimal
- [ ] Offline capability is essential
- [ ] Users can stay still during measurement
- [ ] Lighting can be controlled
- [ ] Regulatory compliance is needed
- [ ] You prefer deterministic algorithms
Hybrid Approach
For maximum flexibility, implement both and let users or conditions decide:
function selectEstimator(conditions: {
lighting: 'good' | 'poor';
motion: 'still' | 'moving';
connectivity: 'online' | 'offline';
priority: 'speed' | 'accuracy';
}): RealtimeEstimatorType {
// Offline or poor connectivity → Panoptic
if (conditions.connectivity === 'offline') {
return RealtimeEstimatorType.Panoptic;
}
// Poor lighting or motion → ME-rPPG
if (conditions.lighting === 'poor' || conditions.motion === 'moving') {
return RealtimeEstimatorType.MeRppg;
}
// Speed priority → Panoptic (instant init)
if (conditions.priority === 'speed') {
return RealtimeEstimatorType.Panoptic;
}
// Panoptic is the default estimator
return RealtimeEstimatorType.Panoptic;
}
// Usage
const estimatorType = selectEstimator({
lighting: detectLightingConditions(),
motion: detectMotionLevel(),
connectivity: navigator.onLine ? 'online' : 'offline',
priority: 'accuracy'
});
const camera = createVitalSignCamera({
realtimeEstimationConfig: {
estimatorType
}
});Summary
| Scenario | Recommended | Reason |
|---|---|---|
| Medical Apps | Panoptic | Regulatory compliance, deterministic |
| Fitness Apps | ME-rPPG | Motion tolerance, AI robustness |
| Mobile Apps | ME-rPPG | Varying conditions, modern devices |
| Embedded Systems | Panoptic | Minimal resources, instant init |
| PWAs | ME-rPPG + Panoptic fallback | Best experience with safety net |
| Research | Both | Compare approaches |
| Offline-First | Panoptic | No model downloads |
| Open-Source Projects | ME-rPPG | Licensing requirements |
Next Steps
Review Detailed Guides:
Configure Your Estimator:
Optimize Performance:
Handle Edge Cases: