File size: 730 Bytes
19f420a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# drive_paddy/detection/base_processor.py
from abc import ABC, abstractmethod

class BaseProcessor(ABC):
    """
    Abstract Base Class for a drowsiness detection processor.
    
    This defines the common interface that all detection strategies
    (e.g., Geometric, CNN Model) must follow.
    """
    
    @abstractmethod
    def process_frame(self, frame):
        """
        Processes a single video frame to detect drowsiness.

        Args:
            frame: The video frame (as a NumPy array) to process.

        Returns:
            A tuple containing:
            - The processed frame (NumPy array) with visualizations.
            - A boolean indicating if an alert should be triggered.
        """
        pass