eeeeeeeeeeeeee3 commited on
Commit
f5e4bc7
·
verified ·
1 Parent(s): 75badb7

Upload configs/rtdetr_r50vd_open_soccer_ball_augmented.yml with huggingface_hub

Browse files
configs/rtdetr_r50vd_open_soccer_ball_augmented.yml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RF-DETR Configuration for Ball-Only Detection on Open Soccer Ball Dataset
2
+ # Based on rtdetr_r50vd_ball.yml, adapted for Open Soccer Ball Dataset
3
+ # Dataset: Pascal VOC XML format (robot's fisheye perspective)
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
+ # Source dataset in Pascal VOC XML format (will be converted to COCO)
17
+ voc_train_path: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/training/training"
18
+ voc_train_annotations: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/training/training/annotations"
19
+ voc_train_images: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/training/training/images"
20
+ voc_val_path: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/test/ball"
21
+ voc_val_annotations: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/test/ball/annotations"
22
+ voc_val_images: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/test/ball/img"
23
+ # Output COCO format dataset (created during conversion)
24
+ coco_train_path: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/training/training_coco"
25
+ coco_val_path: "/workspace/soccer_coach_cv/data/raw/Open Soccer Ball Dataset/test/ball_coco"
26
+ # COCO category name
27
+ category_name: "ball"
28
+ category_id: 0 # Single class, use ID 0
29
+
30
+ # Training Hyperparameters - Fresh Start with Augmentation (avoiding resume issues)
31
+ training:
32
+ epochs: 7 # Train for 7 epochs with enhanced augmentations
33
+ # Removed resume parameter to avoid RF-DETR resume bugs
34
+ batch_size: 2 # Reduced for memory constraints (high resolution images)
35
+ learning_rate: 0.0002 # 2e-4 - slightly higher for small objects
36
+ grad_accum_steps: 16 # Increased gradient accumulation to maintain effective batch size (2*16=32)
37
+ weight_decay: 0.0001 # 1e-4
38
+ warmup_epochs: 1 # Short warmup for stability
39
+ # RF-DETR specific training parameters
40
+ lr_encoder: null # Use default encoder learning rate
41
+ resolution: 1288 # High resolution to preserve tiny balls (1288=23*56, divisible by 56, close to 1280)
42
+ device: "cpu" # Try CPU first to debug
43
+ num_workers: 2 # Reduced data loading workers to save memory
44
+
45
+ # Data Augmentation - Enhanced for Real Soccer Game Generalization (RF-DETR Compatible)
46
+ augmentation:
47
+ # Resize augmentation - preserve tiny balls
48
+ resize:
49
+ min_size: 1288 # High resolution to preserve ball visibility
50
+ max_size: 1288 # Fixed high resolution
51
+ scale_range: [1.0, 1.0] # No scaling - keep full resolution
52
+
53
+ # RandomCrop - DISABLED to avoid cropping out tiny balls
54
+ random_crop:
55
+ enabled: false # Critical: tiny balls are easily cropped out
56
+
57
+ # Enhanced Mosaic augmentation - Strongest tool for background generalization
58
+ mosaic:
59
+ enabled: true # Enable Mosaic for data augmentation
60
+ prob: 1.0 # Apply mosaic 100% of the time (maximum variety)
61
+ # Careful implementation: ensure balls are fully within final image bounds
62
+ min_bbox_size: 5 # Minimum bbox size in pixels to keep
63
+ border_margin: 10 # Margin from border to ensure balls aren't cut off
64
+
65
+ # Horizontal flip - safe for balls (no vertical flip - gravity constraint)
66
+ horizontal_flip:
67
+ enabled: true
68
+ prob: 0.5
69
+
70
+ # Enhanced Color jitter - Simulate different soccer conditions
71
+ color_jitter:
72
+ enabled: true
73
+ brightness: 0.4 # Simulate shadows/sunlight (was 0.1)
74
+ contrast: 0.1 # Maintain contrast
75
+ saturation: 0.7 # Simulate wet vs dry pitch (was 0.1)
76
+ hue: 0.015 # Simulate different grass shades (was 0.05)
77
+
78
+ # Motion blur - ENABLED to simulate camera motion in games
79
+ motion_blur:
80
+ enabled: true # Enable to simulate real game motion
81
+ prob: 0.3 # Apply 30% of the time
82
+
83
+ # Multi-scale training - ENABLED for distance generalization
84
+ multi_scale:
85
+ enabled: true # Enable for balls at different distances
86
+ scale_range: [0.5, 1.5] # Allow some scaling while preserving resolution
87
+
88
+ # Output Configuration
89
+ output:
90
+ output_dir: "models/ball_detection_open_soccer_ball" # Directory for checkpoints and training artifacts
91
+ save_frequency: 5 # Save checkpoint every N epochs
92
+ save_best: true # Save best model based on validation mAP
93
+ metric: "mAP" # Use mAP for model selection
94
+
95
+ # Evaluation Configuration
96
+ evaluation:
97
+ iou_thresholds: [0.5, 0.75] # IoU thresholds for mAP calculation
98
+ max_detections: 100 # Maximum detections per image
99
+ eval_frequency: 1 # Evaluate every N epochs (1 = every epoch)
100
+ test_video_path: "data/raw/real_data/F9D97C58-4877-4905-9A9F-6590FCC758FF.mp4" # First 100 frames test set
101
+ num_test_frames: 100 # Number of frames to evaluate
102
+
103
+ # Logging
104
+ logging:
105
+ log_dir: "logs/ball_detection_open_soccer_ball"
106
+ tensorboard: true
107
+ mlflow: true # Enable MLflow tracking
108
+ mlflow_tracking_uri: "file:./mlruns" # Local file-based tracking
109
+ mlflow_experiment_name: "ball_detection_open_soccer_ball" # MLflow experiment name
110
+ print_frequency: 20 # Print training stats every N iterations