UNPKG

bowling-analysis-system

Version:

A comprehensive system for analyzing bowling techniques using video processing and metrics calculation

65 lines (56 loc) 1.79 kB
/** * @module bowling_analysis/utils/BiasConfigManager * @description Centralized bias configuration management */ const DEFAULT_THRESHOLDS = { // Core confidence thresholds CONFIDENCE_THRESHOLD: 0.6, EVENT_CONFIDENCE_THRESHOLD: 0.7, BIAS_CONFIDENCE_THRESHOLD: 0.75, // Event-specific thresholds RELEASE_POINT_THRESHOLD: 0.8, FOOT_LANDING_THRESHOLD: 0.7, // Bias analysis thresholds BIAS_CORRELATION_THRESHOLD: 0.65, BIAS_SIGNIFICANCE_THRESHOLD: 0.6 }; const DEFAULT_BIAS_CONFIG = { // Core settings enabled: true, validateSequence: true, confidenceThreshold: DEFAULT_THRESHOLDS.BIAS_CONFIDENCE_THRESHOLD, // Analysis settings correlationThreshold: DEFAULT_THRESHOLDS.BIAS_CORRELATION_THRESHOLD, significanceThreshold: DEFAULT_THRESHOLDS.BIAS_SIGNIFICANCE_THRESHOLD, // Event settings eventConfidenceThreshold: DEFAULT_THRESHOLDS.EVENT_CONFIDENCE_THRESHOLD, eventValidation: { requireAllEvents: true, validateFrameSequence: true } }; /** * Get environment-aware configuration * @returns {Object} Configuration with environment overrides */ function getConfig() { return { ...DEFAULT_BIAS_CONFIG, confidenceThreshold: parseFloat(process.env.CONFIDENCE_THRESHOLD || DEFAULT_THRESHOLDS.CONFIDENCE_THRESHOLD), eventConfidenceThreshold: parseFloat(process.env.EVENT_CONFIDENCE_THRESHOLD || DEFAULT_THRESHOLDS.EVENT_CONFIDENCE_THRESHOLD) }; } /** * Get threshold value * @param {string} thresholdName - Name of threshold * @returns {number} Threshold value */ function getThreshold(thresholdName) { return DEFAULT_THRESHOLDS[thresholdName]; } module.exports = { DEFAULT_THRESHOLDS, DEFAULT_BIAS_CONFIG, getConfig, getThreshold };