# ID Card Data Augmentation Configuration v2.0
# Enhanced configuration with smart sampling, multiplication, and random method combination

# Paths configuration
paths:
  input_dir: "data/IDcards/raw/test"
  output_dir: "out1"
  log_file: "logs/data_augmentation.log"

# Data Sampling and Multiplication Strategy  
data_strategy:
  # Multiplication/Sampling factor:
  # - If < 1.0 (e.g. 0.3): Random sampling 30% of input data to augment
  # - If >= 1.0 (e.g. 2.0, 3.0): Multiply dataset size by 2x, 3x etc.
  multiplication_factor: 0.3
  
  # Random seed for reproducibility (null = random each run)
  random_seed: null
  
  # Sampling strategy for factor < 1.0
  sampling:
    method: "random"  # random, stratified, uniform
    preserve_distribution: true  # Maintain file type distribution

# ID Card Detection configuration
id_card_detection:
  enabled: false  # Enable/disable YOLO detection and cropping
  model_path: "data/weights/id_cards_yolov8n.pt"  # Path to YOLO model
  confidence_threshold: 0.25  # Detection confidence threshold
  iou_threshold: 0.45  # IoU threshold for NMS
  padding: 10  # Extra padding around bounding box
  crop_mode: "bbox"  # Cropping mode: bbox, square, aspect_ratio
  target_size: null  # Target size (width, height) or null
  save_original_crops: true  # Save original cropped images

# Augmentation Strategy - Random Combination of Methods
augmentation:
  # Strategy for combining augmentation methods
  strategy:
    mode: "random_combine"  # random_combine, sequential, individual
    min_methods: 2  # Minimum methods applied per image
    max_methods: 4  # Maximum methods applied per image
    allow_duplicates: false  # Allow same method multiple times with different params
  
  # Available augmentation methods with selection probabilities
  methods:
    # Geometric transformations
    rotation:
      enabled: true
      probability: 0.8  # Selection probability for this method
      angles: [30, 60, 120, 150, 180, 210, 240, 300, 330]
    
    # Random cropping to simulate partially visible ID cards
    random_cropping:
      enabled: true
      probability: 0.7
      ratio_range: [0.7, 1.0]
    
    # Random noise to simulate worn-out ID cards
    random_noise:
      enabled: true
      probability: 0.6
      mean_range: [0.0, 0.7]
      variance_range: [0.0, 0.1]
    
    # Partial blockage to simulate occluded card details
    partial_blockage:
      enabled: true
      probability: 0.5
      num_occlusions_range: [1, 100]
      coverage_range: [0.0, 0.25]
      variance_range: [0.0, 0.1]
    
    # Blurring to simulate motion blur while keeping readability
    blurring:
      enabled: true
      probability: 0.6
      kernel_ratio_range: [0.0, 0.0084]
    
    # Brightness and contrast adjustment for lighting variations
    brightness_contrast:
      enabled: true
      probability: 0.7
      alpha_range: [0.4, 3.0]
      beta_range: [1, 100]
    
    # Color space transformations
    color_jitter:
      enabled: true
      probability: 0.4
      brightness_range: [0.8, 1.2]
      contrast_range: [0.8, 1.2]
      saturation_range: [0.8, 1.2]
      hue_range: [-0.1, 0.1]
    
    # Perspective transformation for viewing angle simulation
    perspective:
      enabled: false
      probability: 0.3
      distortion_scale: 0.2
  
  # Final processing (always applied to all outputs)
  final_processing:
    # Grayscale transformation as final preprocessing step
    grayscale:
      enabled: true
      probability: 1.0  # Always apply to ensure consistency
    
    # Quality enhancement (future feature)
    quality_enhancement:
      enabled: false
      sharpen: 0.1
      denoise: false

# Processing configuration
processing:
  target_size: [640, 640]  # [width, height] - Target resolution
  batch_size: 32
  save_format: "jpg"
  quality: 95
  
  # Advanced processing options
  preserve_original: false  # Whether to save original images
  parallel_processing: true  # Enable parallel processing
  memory_efficient: true  # Optimize memory usage

# Supported image formats
supported_formats:
  - ".jpg"
  - ".jpeg"
  - ".png"
  - ".bmp"
  - ".tiff"

# Logging configuration
logging:
  level: "INFO"  # Available levels: DEBUG, INFO, WARNING, ERROR
  format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  handlers:
    - type: "file"
      filename: "logs/data_augmentation.log"
    - type: "console"

# Performance settings
performance:
  num_workers: 4        # Number of parallel workers
  prefetch_factor: 2    # Data prefetching factor
  pin_memory: true      # Pin memory for GPU transfer
  use_gpu: false        # Enable GPU acceleration 