update augment + YOLO pipeline

This commit is contained in:
Nguyễn Phước Thành
2025-08-06 20:52:39 +07:00
parent 4ee14f17d3
commit 51d3a66cc4
9 changed files with 989 additions and 407 deletions

View File

@@ -7,6 +7,17 @@ paths:
output_dir: "out1"
log_file: "logs/data_augmentation.log"
# ID Card Detection configuration
id_card_detection:
enabled: false # Bật/tắt tính năng detect và crop ID cards
model_path: "data/weights/id_cards_yolov8n.pt" # Đường dẫn đến YOLO model
confidence_threshold: 0.25 # Confidence threshold cho detection
iou_threshold: 0.45 # IoU threshold cho NMS
padding: 10 # Padding thêm xung quanh bbox
crop_mode: "bbox" # Mode cắt: bbox, square, aspect_ratio
target_size: null # Kích thước target (width, height) hoặc null
save_original_crops: true # Có lưu ảnh gốc đã crop không
# Data augmentation parameters - ROTATION and RANDOM CROPPING
augmentation:
# Geometric transformations
@@ -36,11 +47,6 @@ augmentation:
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
@@ -53,6 +59,11 @@ augmentation:
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
# Grayscale transformation as final step (applied to all augmented images)
grayscale:
enabled: true
probability: 1.0 # Always apply grayscale as final step
# Processing configuration
processing: