File size: 906 Bytes
f8f5549
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File: src/EmotionRecognition/components/data_ingestion.py
import os
from EmotionRecognition import logger
from EmotionRecognition.entity.config_entity import DataIngestionConfig

class DataIngestion:
    def __init__(self, config: DataIngestionConfig):
        self.config = config

    def validate_source_data(self):
        """
        Validates the existence of all raw source data files and folders.
        """
        logger.info("Validating source data files and folders...")
        
        all_paths = [
            self.config.root_dir,
            self.config.ferplus_pixels_csv,
            self.config.ferplus_labels_csv,
            self.config.ckplus_dir
        ]

        for path in all_paths:
            if not os.path.exists(path):
                raise FileNotFoundError(f"Missing required raw data source: {path}")

        logger.info("All raw data sources found successfully.")