Files
RoRD-Layout-Recognation/config.py

29 lines
1.1 KiB
Python
Raw Normal View History

2025-06-08 15:38:56 +08:00
# config.py
2025-07-22 23:43:35 +08:00
# --- Training Parameters ---
LEARNING_RATE = 5e-5 # Reduce learning rate for improved training stability
BATCH_SIZE = 8 # Increase batch size for improved training efficiency
NUM_EPOCHS = 50 # Increase training epochs
2025-06-08 15:38:56 +08:00
PATCH_SIZE = 256
2025-07-22 23:43:35 +08:00
# (Optimization) Scale jitter range during training - reduced range for improved stability
2025-06-30 03:27:18 +08:00
SCALE_JITTER_RANGE = (0.8, 1.2)
2025-06-08 15:38:56 +08:00
2025-07-22 23:43:35 +08:00
# --- Matching and Evaluation Parameters ---
2025-06-08 15:38:56 +08:00
KEYPOINT_THRESHOLD = 0.5
RANSAC_REPROJ_THRESHOLD = 5.0
2025-06-09 01:49:13 +08:00
MIN_INLIERS = 15
2025-06-08 15:38:56 +08:00
IOU_THRESHOLD = 0.5
2025-07-22 23:43:35 +08:00
# (New) Image pyramid scales for template matching during inference
2025-06-09 01:49:13 +08:00
PYRAMID_SCALES = [0.75, 1.0, 1.5]
2025-07-22 23:43:35 +08:00
# (New) Sliding window parameters for processing large layouts during inference
2025-06-09 01:49:13 +08:00
INFERENCE_WINDOW_SIZE = 1024
2025-07-22 23:43:35 +08:00
INFERENCE_STRIDE = 768 # Less than INFERENCE_WINDOW_SIZE to ensure overlap
2025-06-08 15:38:56 +08:00
2025-07-22 23:43:35 +08:00
# --- File Paths ---
# (Paths remain unchanged, please modify according to your environment)
2025-06-08 15:38:56 +08:00
LAYOUT_DIR = 'path/to/layouts'
SAVE_DIR = 'path/to/save'
VAL_IMG_DIR = 'path/to/val/images'
VAL_ANN_DIR = 'path/to/val/annotations'
TEMPLATE_DIR = 'path/to/templates'
MODEL_PATH = 'path/to/save/model_final.pth'