How sleep-revolution/sleepscorergray works
Main Components Identification
a) Web Layer
• Represents the frontend (web/index.html, web/download.html)
b) API Layer
• In the middle
• FastAPI application (indicated by uvicorn server usage)
• Entry point through main.py
c) GrayAreaDL Core
• At the bottom
• Contains the machine learning and signal processing components
Detailed Component Breakdown
a) Data Processing Pipeline:
• Data Input
• Preprocessing (preprocessing/ directory)
• Signal Filters (bpfilter, chebyhpfilter)
• Signal Processing (harmonisation, resample, reshape)
• Feature Extraction (spectrograms)
b) Model Components:
• Model Architecture (model/model.py)
• Mixture Models (model/mixturemodels.py)
• Custom Callbacks (model/callbacks.py)
c) Prediction Flow:
• Flow through:
• Data Generator (data/datagenerator.py)
• Predictors (data/predictors.py)
• Prediction Processing (data/prediction.py)
Data Flow Representation
• Client Request → Web Interface
• Web Interface → FastAPI Endpoint
• FastAPI → GrayAreaDL Core
• Within GrayAreaDL: Input → Preprocessing → Model → Prediction → Response
Configuration and Utilities
• Configuration Management (conf/ directory)
• Utility Services (utils/ directory)
• Logging System (logs/ directory)
Technical Details
Annotations for:
• FastAPI running on uvicorn
• Port 8002 specification
• Supported file formats
• Key dependencies