Files
IDcardsGenerator/config/config.yaml

87 lines
2.6 KiB
YAML
Raw Normal View History

2025-08-05 19:09:55 +07:00
# Data Augmentation Configuration
# Main configuration file for image data augmentation
# Paths configuration
paths:
2025-08-06 19:03:17 +07:00
input_dir: "data/IDcards/raw/test"
output_dir: "out1"
2025-08-05 19:09:55 +07:00
log_file: "logs/data_augmentation.log"
2025-08-05 21:42:23 +07:00
# Data augmentation parameters - ROTATION and RANDOM CROPPING
2025-08-05 19:09:55 +07:00
augmentation:
2025-08-05 21:42:23 +07:00
# Geometric transformations
2025-08-05 19:09:55 +07:00
rotation:
enabled: true
angles: [30, 60, 120, 150, 180, 210, 240, 300, 330] # Specific rotation angles
probability: 1.0 # Always apply rotation
2025-08-05 21:42:23 +07:00
# Random cropping to simulate partially visible ID cards
random_cropping:
enabled: true
ratio_range: [0.7, 1.0] # Crop ratio range (min, max)
probability: 1.0 # Always apply cropping
# Random noise to simulate worn-out ID cards
random_noise:
enabled: true
mean_range: [0.0, 0.7] # Noise mean range (min, max)
variance_range: [0.0, 0.1] # Noise variance range (min, max)
probability: 1.0 # Always apply noise
# Partial blockage to simulate occluded card details
partial_blockage:
enabled: true
num_occlusions_range: [1, 100] # Number of occlusion lines (min, max)
coverage_range: [0.0, 0.25] # Coverage ratio (min, max)
variance_range: [0.0, 0.1] # Line thickness variance (min, max)
probability: 1.0 # Always apply blockage
# Grayscale transformation to mimic Xerox/scan copies
grayscale:
enabled: true
probability: 1.0 # Always apply grayscale
# Blurring to simulate blurred card images that are still readable
blurring:
enabled: true
kernel_ratio_range: [0.0, 0.0084] # Kernel ratio range (min, max)
probability: 1.0 # Always apply blurring
# Brightness and contrast adjustment to mimic different environmental lighting conditions
brightness_contrast:
enabled: true
alpha_range: [0.4, 3.0] # Contrast range (min, max)
beta_range: [1, 100] # Brightness range (min, max)
probability: 1.0 # Always apply brightness/contrast adjustment
2025-08-05 19:09:55 +07:00
# Processing configuration
processing:
2025-08-05 20:53:47 +07:00
target_size: [640, 640] # [width, height] - Increased for better coverage
2025-08-05 19:09:55 +07:00
batch_size: 32
num_augmentations: 3 # number of augmented versions per image
save_format: "jpg"
quality: 95
# Supported image formats
supported_formats:
- ".jpg"
- ".jpeg"
- ".png"
- ".bmp"
- ".tiff"
# Logging configuration
logging:
level: "INFO" # 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
prefetch_factor: 2
pin_memory: true
use_gpu: false