Upload configs/rtdetr_r50vd_ball_combined_optimized.yml with huggingface_hub
Browse files
configs/rtdetr_r50vd_ball_combined_optimized.yml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RF-DETR Configuration for Combined Ball-Only Detection
|
| 2 |
+
# Optimized for NVIDIA A40 (46GB VRAM) - Maximum Speed Configuration
|
| 3 |
+
# Dataset: Combined Open Soccer Ball Dataset + SoccerSynth Sub Sub
|
| 4 |
+
|
| 5 |
+
# Model Architecture
|
| 6 |
+
model:
|
| 7 |
+
architecture: "rfdetr" # RF-DETR from Roboflow
|
| 8 |
+
backbone: "resnet50vd" # ResNet50-VD backbone
|
| 9 |
+
rfdetr_size: "base" # RF-DETR Base model (29M parameters)
|
| 10 |
+
num_classes: 1 # Ball only (class ID 0)
|
| 11 |
+
remap_mscoco_category: false # Using custom data, not COCO
|
| 12 |
+
pretrained: true # Use pre-trained weights
|
| 13 |
+
|
| 14 |
+
# Dataset Configuration
|
| 15 |
+
dataset:
|
| 16 |
+
# Combined dataset (ball-only) - already in COCO format
|
| 17 |
+
coco_train_path: "/workspace/datasets/combined_ball_only/train"
|
| 18 |
+
coco_val_path: "/workspace/datasets/combined_ball_only/val"
|
| 19 |
+
# COCO category name
|
| 20 |
+
category_name: "ball"
|
| 21 |
+
category_id: 0 # Single class, use ID 0
|
| 22 |
+
use_combined_dataset: false # Already combined and split
|
| 23 |
+
# For COCO format (not YOLO), these are not needed but set defaults to avoid errors
|
| 24 |
+
ball_class_id: 1 # Not used for COCO, but required by script
|
| 25 |
+
yolo_train_path: "" # Empty - using COCO directly
|
| 26 |
+
yolo_val_path: "" # Empty - using COCO directly
|
| 27 |
+
|
| 28 |
+
# Training Hyperparameters - Optimized for A40 (46GB VRAM)
|
| 29 |
+
training:
|
| 30 |
+
epochs: 20 # Training epochs as requested
|
| 31 |
+
batch_size: 16 # Large batch size for A40 (can go higher with 46GB VRAM)
|
| 32 |
+
learning_rate: 0.0002 # 2e-4 - slightly higher for small objects
|
| 33 |
+
grad_accum_steps: 4 # Gradient accumulation (effective batch: 16*4=64)
|
| 34 |
+
weight_decay: 0.0001 # 1e-4
|
| 35 |
+
warmup_epochs: 5
|
| 36 |
+
# RF-DETR specific training parameters
|
| 37 |
+
lr_encoder: null # Use default encoder learning rate
|
| 38 |
+
resolution: 1288 # High resolution to preserve tiny balls
|
| 39 |
+
device: "cuda" # Use GPU
|
| 40 |
+
num_workers: 8 # More workers for faster data loading (A40 has plenty of RAM)
|
| 41 |
+
|
| 42 |
+
# Speed optimizations
|
| 43 |
+
mixed_precision: true # FP16/FP32 mixed precision for 2x speed
|
| 44 |
+
channels_last: true # Channels-last memory format for faster convolutions
|
| 45 |
+
tf32: true # Enable TF32 on Ampere GPUs (A40) for faster matmul
|
| 46 |
+
compile_model: false # Disabled: causes recompilation overhead with variable-sized DETR inputs
|
| 47 |
+
cudnn_benchmark: true # Optimize CUDNN for consistent input sizes
|
| 48 |
+
pin_memory: true # Pin memory for faster GPU transfer
|
| 49 |
+
prefetch_factor: 4 # Prefetch more batches
|
| 50 |
+
persistent_workers: true # Keep workers alive between epochs
|
| 51 |
+
|
| 52 |
+
# Data Augmentation - Optimized for Tiny Objects (<15 pixels)
|
| 53 |
+
augmentation:
|
| 54 |
+
# Resize augmentation - preserve tiny balls
|
| 55 |
+
resize:
|
| 56 |
+
min_size: 1288 # High resolution to preserve ball visibility
|
| 57 |
+
max_size: 1288 # Fixed high resolution
|
| 58 |
+
scale_range: [1.0, 1.0] # No scaling - keep full resolution
|
| 59 |
+
|
| 60 |
+
# RandomCrop - DISABLED to avoid cropping out tiny balls
|
| 61 |
+
random_crop:
|
| 62 |
+
enabled: false # Critical: tiny balls are easily cropped out
|
| 63 |
+
|
| 64 |
+
# Mosaic augmentation - CAREFULLY implemented to avoid cutting balls
|
| 65 |
+
mosaic:
|
| 66 |
+
enabled: true # Enable Mosaic for data augmentation
|
| 67 |
+
prob: 0.5 # Apply mosaic 50% of the time
|
| 68 |
+
min_bbox_size: 5 # Minimum bbox size in pixels to keep
|
| 69 |
+
border_margin: 10 # Margin from border to ensure balls aren't cut off
|
| 70 |
+
|
| 71 |
+
# Horizontal flip - safe for balls
|
| 72 |
+
horizontal_flip:
|
| 73 |
+
enabled: true
|
| 74 |
+
prob: 0.5
|
| 75 |
+
|
| 76 |
+
# Color jitter - reduced intensity for tiny objects
|
| 77 |
+
color_jitter:
|
| 78 |
+
enabled: true
|
| 79 |
+
brightness: 0.1 # Reduced for tiny objects
|
| 80 |
+
contrast: 0.1
|
| 81 |
+
saturation: 0.1
|
| 82 |
+
hue: 0.05
|
| 83 |
+
|
| 84 |
+
# Motion blur - DISABLED for training
|
| 85 |
+
motion_blur:
|
| 86 |
+
enabled: false
|
| 87 |
+
|
| 88 |
+
# Multi-scale training - DISABLED to preserve resolution
|
| 89 |
+
multi_scale:
|
| 90 |
+
enabled: false
|
| 91 |
+
|
| 92 |
+
# Output Configuration
|
| 93 |
+
output:
|
| 94 |
+
output_dir: "models/ball_detection_combined_optimized" # Directory for checkpoints
|
| 95 |
+
save_frequency: 5 # Save checkpoint every N epochs
|
| 96 |
+
save_best: true # Save best model based on validation mAP
|
| 97 |
+
metric: "mAP" # Use mAP for model selection
|
| 98 |
+
|
| 99 |
+
# Evaluation Configuration
|
| 100 |
+
evaluation:
|
| 101 |
+
iou_thresholds: [0.5, 0.75] # IoU thresholds for mAP calculation
|
| 102 |
+
max_detections: 100 # Maximum detections per image
|
| 103 |
+
eval_frequency: 1 # Evaluate every N epochs (1 = every epoch)
|
| 104 |
+
|
| 105 |
+
# Logging
|
| 106 |
+
logging:
|
| 107 |
+
log_dir: "logs/ball_detection_combined_optimized"
|
| 108 |
+
tensorboard: true
|
| 109 |
+
mlflow: true # Enable MLflow tracking
|
| 110 |
+
mlflow_tracking_uri: "file:./mlruns" # Local file-based tracking
|
| 111 |
+
mlflow_experiment_name: "ball_detection_combined_optimized" # MLflow experiment name
|
| 112 |
+
print_frequency: 20 # Print training stats every N iterations
|