File size: 1,111 Bytes
fca155a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
from pathlib import Path
from pydantic import BaseModel, Field

class ProjectPaths(BaseModel):
    """Defines the standard file paths for the project."""
    root: Path = Path(__file__).parent.parent.parent
    models_dir: Path = Field(default_factory=lambda: Path(__file__).parent.parent.parent / "models")
    data_dir: Path = Field(default_factory=lambda: Path(__file__).parent.parent.parent / "data")
    
    @property
    def model_path(self) -> Path:
        # Default model name
        return self.models_dir / "Qwen2-VL-2B-Instruct-Q4_K_M.gguf"

class PerceptionSettings(BaseModel):
    """Tunable parameters for the vision system."""
    frame_interval: int = 2  # Process 1 frame every X seconds
    ssim_threshold: float = 0.90  # Similarity threshold to skip frames (0.0 - 1.0)
    
class Config(BaseModel):
    """Global Application Configuration."""
    paths: ProjectPaths = Field(default_factory=ProjectPaths)
    perception: PerceptionSettings = Field(default_factory=PerceptionSettings)
    
    class Config:
        arbitrary_types_allowed = True

# Singleton instance
settings = Config()