AlbeRota commited on
Commit
679c502
·
verified ·
1 Parent(s): c9f4709

Upload weights, notebooks, sample images

Browse files
configs/decoder_pretrain.yaml ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### BASELINE: CONVERGES AFTER LONG
2
+
3
+ parameters:
4
+
5
+ ### MODEL ARCHITECTURE
6
+ MODEL:
7
+ value:
8
+ MODEL_CLASS: "UnReflect_Model" # Main model class name (must match class in models.py) # <<<<<<<<< DECODER PRETRAINING: NOT USING TOKEN INPAINTER (DIRECT FROM DINO)
9
+ MODEL_MODULE: "models" # Module name to import model classes from (default: "models")
10
+ RGB_ENCODER:
11
+ ENCODER: "facebook/dinov3-vitl16-pretrain-lvd1689m" # DINOv3 encoder model name (HuggingFace format)
12
+ IMAGE_SIZE: 896 # Input image size (height and width in pixels)
13
+ RETURN_SELECTED_LAYERS: [3, 6, 9, 12] # Transformer layer indices to extract features from (0-indexed)
14
+ RGB_ENCODER_LR: 0.0 # Learning rate for RGB encoder (0.0 = frozen, must be explicitly set)
15
+ DECODERS:
16
+ diffuse:
17
+ USE_FILM: False # Enable FiLM (Feature-wise Linear Modulation) conditioning in decoder
18
+ FEATURE_DIM: 1024 # Feature dimension for decoder (should match encoder output)
19
+ REASSEMBLE_OUT_CHANNELS: [768,1024,1536,2048] # Output channels for each decoder stage (DPT-style reassembly)
20
+ REASSEMBLE_FACTORS: [4.0, 2.0, 1.0, 0.5] # Spatial upsampling factors for each stage
21
+ READOUT_TYPE: "ignore" # Readout type for DPT decoder ("ignore", "project", etc.)
22
+ # FROM_PRETRAINED: "weights/rgb_decoder.pth" # Path to pretrained decoder weights (optional) # <<<<<<<<< DECODER PRETRAINING: NO WEIGHTS HERE
23
+ USE_BN: False # Use batch normalization in decoder
24
+ DROPOUT: 0.1 # Dropout rate in decoder layers
25
+ OUTPUT_IMAGE_SIZE: [896,896] # Output image resolution [height, width]
26
+ OUTPUT_CHANNELS: 3 # Number of output channels (3 for RGB diffuse image)
27
+ DECODER_LR: 5.0e-5 # Custom learning rate for decoder (0.0 = frozen, 1.0 = same as base LR)
28
+ NUM_FUSION_BLOCKS_TRAINABLE: null # Number of fusion blocks to train (0-4, null = train all if DECODER_LR != 0)
29
+ TRAIN_RGB_HEAD: True # Whether to train RGB head (true/false, null = train if DECODER_LR != 0)
30
+ TOKEN_INPAINTER:
31
+ TOKEN_INPAINTER_CLASS: "TokenInpainter_Prior" # Token inpainter class name
32
+ TOKEN_INPAINTER_MODULE: "token_inpainters" # Module name to import token inpainter from
33
+ FROM_PRETRAINED: "weights/token_inpainter.pth" # Path to pretrained token inpainter weights (optional)
34
+ TOKEN_INPAINTER_LR: 1.0e-5 # Learning rate for token inpainter (can differ from base LR)
35
+ DEPTH: 6 # Number of transformer blocks
36
+ HEADS: 16 # Number of attention heads
37
+ DROP: 0 # Dropout rate
38
+ USE_POSITIONAL_ENCODING: True # Enable 2D sinusoidal positional encodings
39
+ USE_FINAL_NORM: True # Enable final LayerNorm before output projection
40
+ USE_LOCAL_PRIOR: True # Blend local mean prior for masked seeds
41
+ LOCAL_PRIOR_WEIGHT: 0.5 # Weight for local prior blending (1.0 = only mask_token, 0.0 = only local mean)
42
+ LOCAL_PRIOR_KERNEL: 5 # Kernel size for local prior blending (> 1)
43
+ SEED_NOISE_STD: 0.02 # Standard deviation of noise added to masked seeds during training
44
+ INPAINT_MASK_DILATION:
45
+ value: 3 # Dilation kernel size (pixels) for inpaint mask - Must be odd
46
+ USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
47
+ value: False
48
+ DISTRIBUTE:
49
+ value: "ddp"
50
+
51
+ ### DATA
52
+ DATASETS:
53
+ value:
54
+ SCRREAM:
55
+ VAL_SCENES: ["scene10_full_00","scene11_full_00","scene044_full_00","scene04_reduced_00","scene04_reduced_01","scene04_reduced_02"] # List of validation scene names
56
+ TARGET_SIZE: [896,896] # Target image size [height, width] in pixels
57
+ RESIZE_MODE: "resize+crop" # Image resizing mode: "resize", "crop", "resize+crop", or "pad"
58
+ FEW_IMAGES: False # If True, load only first 10 images per scene (for quick debugging)
59
+ SAMPLE_EVERY_N: 2 # Load every Nth frame from each scene (1 = all frames, 4 = every 4th frame)
60
+ LOAD_RGB_ONLY: True # If True, ignore polarization data and load only RGB images
61
+
62
+ HOUSECAT6D:
63
+ VAL_SCENES: ["val_scene1","val_scene2"] # Validation scene names
64
+ TARGET_SIZE: [896,896] # Target image size [height, width]
65
+ RESIZE_MODE: "resize+crop" # Image resizing mode
66
+ FEW_IMAGES: False # Load only first 10 images if True
67
+ SAMPLE_EVERY_N: 2 # Load every Nth frame
68
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
69
+
70
+ CROMO:
71
+ TRAIN_SCENES: ["kitchen"] # Training scene names (list or string)
72
+ # VAL_SCENES: "station" # Validation scene names (optional)
73
+ TARGET_SIZE: [896,896] # Target image size [height, width]
74
+ RESIZE_MODE: "resize" # Image resizing mode
75
+ FEW_IMAGES: False # Load only first 10 images if True
76
+ SAMPLE_EVERY_N: 2 # Load every Nth frame
77
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
78
+
79
+ PSD:
80
+ TRAIN_SCENES: "PSD_Train" # Training scene name (string or list)
81
+ VAL_SCENES: "PSD_Val" # Validation scene name (string or list)
82
+ TARGET_SIZE: [896,896] # Target image size [height, width]
83
+ RESIZE_MODE: "resize+crop" # Image resizing mode
84
+ FEW_IMAGES: False # Load only first 10 images if True
85
+ SAMPLE_EVERY_N: 1 # Load every Nth frame (1 = all frames)
86
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
87
+
88
+ SCARED:
89
+ VAL_SCENES: ["v22","v23","v24","v25","v26","v27","v28","v29","v30","v31","v32","v33","v34"] # Validation scene names
90
+ TARGET_SIZE: [896,896] # Target image size [height, width]
91
+ RESIZE_MODE: "resize+crop" # Image resizing mode
92
+ SAMPLE_EVERY_N: 8 # Load every Nth frame
93
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
94
+ FEW_IMAGES: False # Load only first 10 images if True
95
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing in dataset
96
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection (0-1)
97
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
98
+ HIGHLIGHT_RECT_SIZE: [1000, 1000] # Size of highlight rectangle region [height, width]
99
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
100
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
101
+
102
+ STEREOMIS_TRACKING:
103
+ VAL_SCENES: ["P2_2"] # Validation scene names
104
+ TARGET_SIZE: [896,896] # Target image size [height, width]
105
+ RESIZE_MODE: "resize+crop" # Image resizing mode
106
+ SAMPLE_EVERY_N: 4 # Load every Nth frame
107
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
108
+ FEW_IMAGES: False # Load only first 10 imagas if True
109
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing
110
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection
111
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
112
+ HIGHLIGHT_RECT_SIZE: [800, 800] # Size of highlight rectangle region
113
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
114
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
115
+
116
+ CHOLEC80:
117
+ VAL_SCENES: ["val"] # Validation scene names
118
+ TARGET_SIZE: [896,896] # Target image size [height, width]
119
+ RESIZE_MODE: "resize+crop" # Image resizing mode
120
+ SAMPLE_EVERY_N: 10 # Load every Nth frame
121
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
122
+ FEW_IMAGES: False # Load only first 10 images if True
123
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing
124
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection
125
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
126
+ HIGHLIGHT_RECT_SIZE: [800, 800] # Size of highlight rectangle region
127
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
128
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
129
+
130
+ SUNRGBD:
131
+ VAL_SCENES: ["realsense"] # Validation scene names
132
+ TARGET_SIZE: [896,896] # Target image size [height, width]
133
+ RESIZE_MODE: "resize+crop" # Image resizing mode
134
+ SAMPLE_EVERY_N: 1 # Load every Nth frame
135
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
136
+ FEW_IMAGES: False # Load only first 10 images if True
137
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing
138
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection
139
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
140
+ HIGHLIGHT_RECT_SIZE: [800, 800] # Size of highlight rectangle region
141
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
142
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
143
+
144
+ FEW_IMAGES_OVERRIDE:
145
+ value: False # If True, override all datasets' FEW_IMAGES to True (for quick debugging across all datasets)
146
+
147
+ BATCH_SIZE: # Max batch size with img size 896 is 32
148
+ value: 4 # Number of samples per batch (adjust based on GPU memory)
149
+ NUM_WORKERS:
150
+ value: 12 # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
151
+ SHUFFLE:
152
+ value: True # Shuffle training data each epoch (False for validation/test)
153
+ PIN_MEMORY:
154
+ value: True # Pin memory in DataLoader for faster GPU transfer (recommended: True)
155
+ PREFETCH_FACTOR:
156
+ value: 2 # Number of batches to prefetch per worker (higher = more memory usage)
157
+
158
+ ### HIGHLIGHTS
159
+ MOGE_MODEL:
160
+ value: "Ruicheng/moge-2-vits-normal" # MoGe model name for normal estimation (HuggingFace format)
161
+ SURFACE_ROUGHNESS:
162
+ value: 8.0 # Blinn-Phong surface roughness exponent (higher = sharper highlights)
163
+ INTENSITY:
164
+ value: 0.0 # Specular highlight intensity multiplier
165
+ LIGHT_DISTANCE_RANGE:
166
+ value: [0.0, 1] # Range for light source distance sampling [min, max] (normalized)
167
+ LIGHT_LEFT_RIGHT_ANGLE:
168
+ value: [0, 360] # Range for light source horizontal angle [min, max] in degrees
169
+ LIGHT_ABOVE_BELOW_ANGLE:
170
+ value: [0, 360] # Range for light source vertical angle [min, max] in degrees
171
+ DATASET_HIGHLIGHT_DILATION:
172
+ value: 25 #sDilation kernel size (pixels) for dataset highlight masks
173
+ DATASET_HIGHLIGHT_THRESHOLD:
174
+ value: 0.9 # Brightness/luminance threshold (0-1) for detecting highlights in dataset images
175
+ DATASET_HIGHLIGHT_USE_LUMINANCE:
176
+ value: True # If True, use perceptually-weighted luminance (0.299*R + 0.587*G + 0.114*B) for dataset highlights; if False, use simple mean brightness
177
+ HIGHLIGHT_COLOR:
178
+ value: [1.0, 1.0, 1.0] # RGB color for synthetic highlights (normalized 0-1)
179
+ CLAMP_RECONSTRUCTION:
180
+ value: True # Clamp reconstructed images to [0, 1] range if True
181
+
182
+ ### OPTIMIZATION
183
+ EPOCHS:
184
+ value: 20 # Maximum number of training epochs<
185
+ LEARNING_RATE:
186
+ value: 1.0e-4 # Base learning rate for optimizer
187
+ WEIGHT_DECAY:
188
+ value: 0.0 # L2 regularization weight (0.0 = no weight decay)
189
+ GRADIENT_ACCUMULATION_STEPS:
190
+ value: 1 # Number of steps to accumulate gradients before optimizer step (1 = no accumulation)
191
+ WARMUP:
192
+ value: 100 # Number of warmup steps for learning rate schedule (linear warmup from 0 to LR)
193
+ GRADIENT_CLIPPING_MAX_NORM:
194
+ value: 8 # Maximum gradient norm for clipping (set to -1 to disable clipping)
195
+ LR_SCHEDULER:
196
+ value:
197
+ ONPLATEAU: # ReduceLROnPlateau scheduler (reduces LR when validation metric plateaus)
198
+ PATIENCE: 5 # Number of epochs to wait before reducing LR
199
+ FACTOR: 0.1 # Factor by which LR is reduced (new_lr = old_lr * factor)
200
+ COSINE: # CosineAnnealingLR scheduler (cosine annealing schedule)
201
+ N_PERIODS: 1 # Number of cosine periods over training
202
+ # STEPWISE: # StepLR scheduler (reduces LR at fixed step intervals)
203
+ # N_STEPS: 5 # Number of times to reduce LR during training
204
+ # GAMMA: 0.25 # Factor by which LR is reduced at each step (new_lr = old_lr * gamma)
205
+ # EXPONENTIAL: # ExponentialLR scheduler (exponential decay)
206
+ # GAMMA: 0.5 # Multiplicative factor for exponential decay
207
+
208
+ SWITCH_OPTIMIZER_EPOCH:
209
+ value: null # Epoch number to switch from bootstrap to refining optimizer (null = no switch)
210
+ OPTIMIZER_BOOTSTRAP_NAME:
211
+ value: "AdamW" # Optimizer name for initial training phase ("Adam", "SGD", etc.)
212
+ OPTIMIZER_REFINING_NAME:
213
+ value: "AdamW" # Optimizer name for refining phase (used after SWITCH_OPTIMIZER_EPOCH)
214
+ EARLY_STOPPING_PATIENCE:
215
+ value: 20 # Number of epochs without improvement before stopping training
216
+ SAVE_INTERVAL:
217
+ value: 1000 # Number of training steps between model checkpoints
218
+
219
+ DATASET_HIGHLIGHT_SUPERVISION_THRESHOLD:
220
+ value: 0.1 # Pixel highlights above this threshold (should be low) are excluded from supervision
221
+
222
+ ### LOSS WEIGHTS (relative to the total loss, NOT NORMALIZED LATER)
223
+ SPECULAR_LOSS_WEIGHT:
224
+ value: 0.0 # Weight for specular component reconstruction loss
225
+ DIFFUSE_LOSS_WEIGHT:
226
+ value: 1.0 # Weight for diffuse component reconstruction loss
227
+ HIGHLIGHT_LOSS_WEIGHT:
228
+ value: 0.0 # Weight for highlight mask regression loss
229
+ IMAGE_RECONSTRUCTION_LOSS_WEIGHT:
230
+ value: 0.0 # Weight for full image reconstruction loss
231
+ SATURATION_RING_LOSS_WEIGHT:
232
+ value: 0.0 # Weight for saturation ring consistency loss (around highlight regions)
233
+ RING_KERNEL_SIZE:
234
+ value: 11 # Kernel size (odd number) for saturation ring dilation around highlights
235
+ RING_VAR_WEIGHT:
236
+ value: 0.5 # Weight for variance matching in saturation ring loss (vs mean matching)
237
+ RING_TEXTURE_WEIGHT:
238
+ value: 0.0 # Weight for texture consistency term in saturation ring loss
239
+ HLREG_W_L1:
240
+ value: 1.0 # Weight for L1 loss in highlight regression
241
+ HLREG_USE_CHARB:
242
+ value: True # Use Charbonnier loss (smooth L1) instead of standard L1 if True
243
+ HLREG_W_DICE:
244
+ value: 0.2 # Weight for Dice loss in highlight regression (for mask overlap)
245
+ HLREG_W_SSIM:
246
+ value: 0.0 # Weight for SSIM loss in highlight regression
247
+ HLREG_W_GRAD:
248
+ value: 0.0 # Weight for gradient loss in highlight regression
249
+ HLREG_W_TV:
250
+ value: 0.0 # Weight for total variation loss in highlight regression
251
+ HLREG_BALANCE_MODE:
252
+ value: "auto" # Class balancing mode for highlight regression: 'none' | 'auto' | 'pos_weight'
253
+ HLREG_POS_WEIGHT:
254
+ value: 1.0 # Positive class weight (used only if BALANCE_MODE == 'pos_weight')
255
+ HLREG_FOCAL_GAMMA:
256
+ value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
257
+
258
+ TOKEN_INPAINT_LOSS_WEIGHT:
259
+ value: 0.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
260
+ WEIGHT_CONTEXT_IDENTITY:
261
+ value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
262
+ WEIGHT_TV_IN_HOLE:
263
+ value: 0.0 # LEAVE TO 0.0: Weight for total variation loss inside masked/hole regions
264
+ RING_DILATE_KERNEL:
265
+ value: 17 # Dilation kernel size (odd number) for creating ring mask around highlights
266
+ WEIGHT_SEAM:
267
+ value: 0.0 # Weight for gradient matching loss on saturation ring
268
+ SEAM_USE_CHARB:
269
+ value: True # Use Charbonnier loss instead of L1 in seam loss (smooth L1 for boundary consistency)
270
+ SEAM_WEIGHT_GRAD:
271
+ value: 0.0 # Weight for gradient matching term inside seam loss (0.0 = disable gradient term)
272
+ TOKEN_FEAT_ALPHA:
273
+ value: 0.5 # Mixing factor for token feature loss: alpha * L1 + (1-alpha) * (1-cosine_sim)
274
+
275
+ ### DIFFUSE HIGHLIGHT PENALTY
276
+ WEIGHT_DIFFUSE_HIGHLIGHT_PENALTY:
277
+ value: 0.0 # Weight for penalty loss on highlights in diffuse decoder output (0.0 = disabled)
278
+ DIFFUSE_HL_THRESHOLD:
279
+ value: 0.8 # Brightness/luminance threshold for detecting highlights in diffuse (0.0-1.0)
280
+ DIFFUSE_HL_USE_CHARB:
281
+ value: True # Use Charbonnier loss instead of L1 for diffuse highlight penalty
282
+ DIFFUSE_HL_PENALTY_MODE:
283
+ value: "brightness" # Penalty mode: "brightness" (penalize brightness/luminance above threshold) or "pixel" (penalize RGB values directly)
284
+ DIFFUSE_HL_TARGET_BRIGHTNESS:
285
+ value: null # Target brightness/luminance for penalized pixels (null = use threshold value)
286
+ DIFFUSE_HL_USE_LUMINANCE:
287
+ value: True # If True, use perceptually-weighted luminance (0.299*R + 0.587*G + 0.114*B); if False, use simple mean brightness
288
+
289
+ ### LOGGING, RESULTS AND WANDB
290
+ LOG_INTERVAL:
291
+ value: 1 # Number of training steps between console log outputs
292
+ WANDB_LOG_INTERVAL:
293
+ value: 1 # Number of training steps between WandB metric logs
294
+ IMAGE_LOG_INTERVAL:
295
+ value: 5 # Number of training steps between image logging to WandB
296
+ NO_WANDB:
297
+ value: False # Disable WandB logging if True (useful for local debugging)
298
+ MODEL_WATCHER_FREQ_WANDB:
299
+ value: 50 # Frequency (in steps) for logging model parameter histograms to WandB
300
+ WANDB_ENTITY:
301
+ value: "unreflect-anything" # WandB organization/entity name
302
+ WANDB_PROJECT:
303
+ value: "UnReflectAnything" # WandB project name
304
+ NOTES:
305
+ value: "896 Decoder Pretraining" # Notes/description for this training run
306
+
configs/pretrained_config.yaml CHANGED
@@ -19,7 +19,7 @@ parameters:
19
  REASSEMBLE_OUT_CHANNELS: [768,1024,1536,2048] # Output channels for each decoder stage (DPT-style reassembly)
20
  REASSEMBLE_FACTORS: [4.0, 2.0, 1.0, 0.5] # Spatial upsampling factors for each stage
21
  READOUT_TYPE: "ignore" # Readout type for DPT decoder ("ignore", "project", etc.)
22
- # FROM_PRETRAINED: "weights/rgb_decoder.pth" # Path to pretrained decoder weights (optional)
23
  USE_BN: False # Use batch normalization in decoder
24
  DROPOUT: 0.1 # Dropout rate in decoder layers
25
  OUTPUT_IMAGE_SIZE: [448,448] # Output image resolution [height, width]
@@ -42,7 +42,7 @@ parameters:
42
  TOKEN_INPAINTER:
43
  TOKEN_INPAINTER_CLASS: "TokenInpainter_Prior" # Token inpainter class name
44
  TOKEN_INPAINTER_MODULE: "token_inpainters" # Module name to import token inpainter from
45
- # FROM_PRETRAINED: "weights/token_inpainter.pth" # Path to pretrained token inpainter weights
46
  TOKEN_INPAINTER_LR: 1.0e-5 # Learning rate for token inpainter (can differ from base LR)
47
  DEPTH: 6 # Number of transformer blocks
48
  HEADS: 16 # Number of attention heads
 
19
  REASSEMBLE_OUT_CHANNELS: [768,1024,1536,2048] # Output channels for each decoder stage (DPT-style reassembly)
20
  REASSEMBLE_FACTORS: [4.0, 2.0, 1.0, 0.5] # Spatial upsampling factors for each stage
21
  READOUT_TYPE: "ignore" # Readout type for DPT decoder ("ignore", "project", etc.)
22
+ FROM_PRETRAINED: "weights/rgb_decoder.pth" # Path to pretrained decoder weights (optional)
23
  USE_BN: False # Use batch normalization in decoder
24
  DROPOUT: 0.1 # Dropout rate in decoder layers
25
  OUTPUT_IMAGE_SIZE: [448,448] # Output image resolution [height, width]
 
42
  TOKEN_INPAINTER:
43
  TOKEN_INPAINTER_CLASS: "TokenInpainter_Prior" # Token inpainter class name
44
  TOKEN_INPAINTER_MODULE: "token_inpainters" # Module name to import token inpainter from
45
+ FROM_PRETRAINED: "weights/token_inpainter.pth" # Path to pretrained token inpainter weights
46
  TOKEN_INPAINTER_LR: 1.0e-5 # Learning rate for token inpainter (can differ from base LR)
47
  DEPTH: 6 # Number of transformer blocks
48
  HEADS: 16 # Number of attention heads
configs/rebuttal/ablate_DWConv.yaml CHANGED
@@ -59,6 +59,8 @@ parameters:
59
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
60
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
61
  value: False
 
 
62
 
63
  ### DATA
64
  DATASETS:
@@ -139,18 +141,12 @@ parameters:
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
- # POLARGB:
143
- # TRAIN_SCENES: "train"
144
- # VAL_SCENES: "test"
145
- # TARGET_SIZE: [448,448]
146
- # RESIZE_MODE: "resize+crop"
147
- # SAMPLE_EVERY_N: 1
148
- # LOAD_RGB_ONLY: True
149
 
150
  BATCH_SIZE: # Max batch size with img size 448 is 32
151
  value: 16 # Number of samples per batch (adjust based on GPU memory)
152
  NUM_WORKERS:
153
- value: 8 # Number of data loading worker processes (0 = main process only)
154
  SHUFFLE:
155
  value: True # Shuffle training data each epoch (False for validation/test)
156
  PIN_MEMORY:
@@ -258,7 +254,7 @@ parameters:
258
  HLREG_FOCAL_GAMMA:
259
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
260
 
261
- WEIGHT_TOKEN_INPAINT:
262
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
263
  WEIGHT_CONTEXT_IDENTITY:
264
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
59
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
60
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
61
  value: False
62
+ USE_DATAPARALLEL:
63
+ value: True
64
 
65
  ### DATA
66
  DATASETS:
 
141
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
142
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
143
 
144
+
 
 
 
 
 
 
145
 
146
  BATCH_SIZE: # Max batch size with img size 448 is 32
147
  value: 16 # Number of samples per batch (adjust based on GPU memory)
148
  NUM_WORKERS:
149
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
150
  SHUFFLE:
151
  value: True # Shuffle training data each epoch (False for validation/test)
152
  PIN_MEMORY:
 
254
  HLREG_FOCAL_GAMMA:
255
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
256
 
257
+ TOKEN_INPAINT_LOSS_WEIGHT:
258
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
259
  WEIGHT_CONTEXT_IDENTITY:
260
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_Dice.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -259,7 +255,7 @@ parameters:
259
  HLREG_FOCAL_GAMMA:
260
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
261
 
262
- WEIGHT_TOKEN_INPAINT:
263
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
264
  WEIGHT_CONTEXT_IDENTITY:
265
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
255
  HLREG_FOCAL_GAMMA:
256
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
257
 
258
+ TOKEN_INPAINT_LOSS_WEIGHT:
259
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
260
  WEIGHT_CONTEXT_IDENTITY:
261
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_L1.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -258,7 +254,7 @@ parameters:
258
  HLREG_FOCAL_GAMMA:
259
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
260
 
261
- WEIGHT_TOKEN_INPAINT:
262
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
263
  WEIGHT_CONTEXT_IDENTITY:
264
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
254
  HLREG_FOCAL_GAMMA:
255
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
256
 
257
+ TOKEN_INPAINT_LOSS_WEIGHT:
258
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
259
  WEIGHT_CONTEXT_IDENTITY:
260
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_LMasktoken.yaml CHANGED
@@ -59,6 +59,8 @@ parameters:
59
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
60
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
61
  value: False
 
 
62
 
63
  ### DATA
64
  DATASETS:
@@ -139,18 +141,12 @@ parameters:
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
- # POLARGB:
143
- # TRAIN_SCENES: "train"
144
- # VAL_SCENES: "test"
145
- # TARGET_SIZE: [448,448]
146
- # RESIZE_MODE: "resize+crop"
147
- # SAMPLE_EVERY_N: 1
148
- # LOAD_RGB_ONLY: True
149
 
150
  BATCH_SIZE: # Max batch size with img size 448 is 32
151
  value: 16 # Number of samples per batch (adjust based on GPU memory)
152
  NUM_WORKERS:
153
- value: 8 # Number of data loading worker processes (0 = main process only)
154
  SHUFFLE:
155
  value: True # Shuffle training data each epoch (False for validation/test)
156
  PIN_MEMORY:
@@ -258,7 +254,7 @@ parameters:
258
  HLREG_FOCAL_GAMMA:
259
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
260
 
261
- WEIGHT_TOKEN_INPAINT:
262
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
263
  WEIGHT_CONTEXT_IDENTITY:
264
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
59
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
60
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
61
  value: False
62
+ USE_DATAPARALLEL:
63
+ value: True
64
 
65
  ### DATA
66
  DATASETS:
 
141
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
142
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
143
 
144
+
 
 
 
 
 
 
145
 
146
  BATCH_SIZE: # Max batch size with img size 448 is 32
147
  value: 16 # Number of samples per batch (adjust based on GPU memory)
148
  NUM_WORKERS:
149
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
150
  SHUFFLE:
151
  value: True # Shuffle training data each epoch (False for validation/test)
152
  PIN_MEMORY:
 
254
  HLREG_FOCAL_GAMMA:
255
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
256
 
257
+ TOKEN_INPAINT_LOSS_WEIGHT:
258
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
259
  WEIGHT_CONTEXT_IDENTITY:
260
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_PosEnc.yaml CHANGED
@@ -59,6 +59,8 @@ parameters:
59
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
60
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
61
  value: False
 
 
62
 
63
  ### DATA
64
  DATASETS:
@@ -139,18 +141,12 @@ parameters:
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
- # POLARGB:
143
- # TRAIN_SCENES: "train"
144
- # VAL_SCENES: "test"
145
- # TARGET_SIZE: [448,448]
146
- # RESIZE_MODE: "resize+crop"
147
- # SAMPLE_EVERY_N: 1
148
- # LOAD_RGB_ONLY: True
149
 
150
  BATCH_SIZE: # Max batch size with img size 448 is 32
151
  value: 16 # Number of samples per batch (adjust based on GPU memory)
152
  NUM_WORKERS:
153
- value: 8 # Number of data loading worker processes (0 = main process only)
154
  SHUFFLE:
155
  value: True # Shuffle training data each epoch (False for validation/test)
156
  PIN_MEMORY:
@@ -258,7 +254,7 @@ parameters:
258
  HLREG_FOCAL_GAMMA:
259
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
260
 
261
- WEIGHT_TOKEN_INPAINT:
262
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
263
  WEIGHT_CONTEXT_IDENTITY:
264
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
59
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
60
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
61
  value: False
62
+ USE_DATAPARALLEL:
63
+ value: True
64
 
65
  ### DATA
66
  DATASETS:
 
141
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
142
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
143
 
144
+
 
 
 
 
 
 
145
 
146
  BATCH_SIZE: # Max batch size with img size 448 is 32
147
  value: 16 # Number of samples per batch (adjust based on GPU memory)
148
  NUM_WORKERS:
149
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
150
  SHUFFLE:
151
  value: True # Shuffle training data each epoch (False for validation/test)
152
  PIN_MEMORY:
 
254
  HLREG_FOCAL_GAMMA:
255
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
256
 
257
+ TOKEN_INPAINT_LOSS_WEIGHT:
258
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
259
  WEIGHT_CONTEXT_IDENTITY:
260
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_RGB.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -255,7 +251,7 @@ parameters:
255
  HLREG_FOCAL_GAMMA:
256
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
257
 
258
- WEIGHT_TOKEN_INPAINT:
259
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
260
  WEIGHT_CONTEXT_IDENTITY:
261
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
251
  HLREG_FOCAL_GAMMA:
252
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
253
 
254
+ TOKEN_INPAINT_LOSS_WEIGHT:
255
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
256
  WEIGHT_CONTEXT_IDENTITY:
257
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_Seam.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -256,7 +252,7 @@ parameters:
256
  HLREG_FOCAL_GAMMA:
257
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
258
 
259
- WEIGHT_TOKEN_INPAINT:
260
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
261
  WEIGHT_CONTEXT_IDENTITY:
262
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
252
  HLREG_FOCAL_GAMMA:
253
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
254
 
255
+ TOKEN_INPAINT_LOSS_WEIGHT:
256
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
257
  WEIGHT_CONTEXT_IDENTITY:
258
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_SoftTHR.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -256,7 +252,7 @@ parameters:
256
  HLREG_FOCAL_GAMMA:
257
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
258
 
259
- WEIGHT_TOKEN_INPAINT:
260
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
261
  WEIGHT_CONTEXT_IDENTITY:
262
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
252
  HLREG_FOCAL_GAMMA:
253
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
254
 
255
+ TOKEN_INPAINT_LOSS_WEIGHT:
256
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
257
  WEIGHT_CONTEXT_IDENTITY:
258
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_Spec.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -258,7 +254,7 @@ parameters:
258
  HLREG_FOCAL_GAMMA:
259
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
260
 
261
- WEIGHT_TOKEN_INPAINT:
262
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
263
  WEIGHT_CONTEXT_IDENTITY:
264
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
254
  HLREG_FOCAL_GAMMA:
255
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
256
 
257
+ TOKEN_INPAINT_LOSS_WEIGHT:
258
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
259
  WEIGHT_CONTEXT_IDENTITY:
260
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/rebuttal/ablate_TV.yaml CHANGED
@@ -57,6 +57,8 @@ parameters:
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
 
 
60
 
61
  ### DATA
62
  DATASETS:
@@ -137,18 +139,12 @@ parameters:
137
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
 
140
- # POLARGB:
141
- # TRAIN_SCENES: "train"
142
- # VAL_SCENES: "test"
143
- # TARGET_SIZE: [448,448]
144
- # RESIZE_MODE: "resize+crop"
145
- # SAMPLE_EVERY_N: 1
146
- # LOAD_RGB_ONLY: True
147
 
148
  BATCH_SIZE: # Max batch size with img size 448 is 32
149
  value: 12 # Number of samples per batch (adjust based on GPU memory)
150
  NUM_WORKERS:
151
- value: 8 # Number of data loading worker processes (0 = main process only)
152
  SHUFFLE:
153
  value: True # Shuffle training data each epoch (False for validation/test)
154
  PIN_MEMORY:
@@ -258,7 +254,7 @@ parameters:
258
  HLREG_FOCAL_GAMMA:
259
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
260
 
261
- WEIGHT_TOKEN_INPAINT:
262
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
263
  WEIGHT_CONTEXT_IDENTITY:
264
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
 
57
  value: 1 # Dilation kernel size (pixels) for inpaint mask - Must be odd
58
  USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
59
  value: False
60
+ USE_DATAPARALLEL:
61
+ value: True
62
 
63
  ### DATA
64
  DATASETS:
 
139
  HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
140
  HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
141
 
142
+
 
 
 
 
 
 
143
 
144
  BATCH_SIZE: # Max batch size with img size 448 is 32
145
  value: 12 # Number of samples per batch (adjust based on GPU memory)
146
  NUM_WORKERS:
147
+ value: "auto" # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
148
  SHUFFLE:
149
  value: True # Shuffle training data each epoch (False for validation/test)
150
  PIN_MEMORY:
 
254
  HLREG_FOCAL_GAMMA:
255
  value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
256
 
257
+ TOKEN_INPAINT_LOSS_WEIGHT:
258
  value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
259
  WEIGHT_CONTEXT_IDENTITY:
260
  value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
configs/tokeninp_preatrain.yaml ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### BASELINE: CONVERGES AFTER LONG
2
+
3
+ parameters:
4
+
5
+ ### MODEL ARCHITECTURE
6
+ MODEL:
7
+ value:
8
+ MODEL_CLASS: "UnReflect_Model_TokenInpainter" # Main model class name (must match class in models.py)
9
+ MODEL_MODULE: "models" # Module name to import model classes from (default: "models")
10
+ RGB_ENCODER:
11
+ ENCODER: "facebook/dinov3-vitl16-pretrain-lvd1689m" # DINOv3 encoder model name (HuggingFace format)
12
+ IMAGE_SIZE: 896 # Input image size (height and width in pixels)
13
+ RETURN_SELECTED_LAYERS: [3, 6, 9 , 12] # Transformer layer indices to extract features from (0-indexed)
14
+ RGB_ENCODER_LR: 0.0 # Learning rate for RGB encoder (0.0 = frozen, must be explicitly set)
15
+ DECODERS:
16
+ diffuse:
17
+ FEATURE_DIM: 1024 # Feature dimension for decoder (should match encoder output)
18
+ REASSEMBLE_OUT_CHANNELS: [768,1024,1536,2048] # Output channels for each decoder stage (DPT-style reassembly)
19
+ REASSEMBLE_FACTORS: [4.0, 2.0, 1.0, 0.5] # Spatial upsampling factors for each stage
20
+ READOUT_TYPE: "ignore" # Readout type for DPT decoder ("ignore", "project", etc.)
21
+ FROM_PRETRAINED: "weights/decoder_896.pth" # Path to pretrained decoder weights (optional)
22
+ USE_BN: False # Use batch normalization in decoder
23
+ DROPOUT: 0.1 # Dropout rate in decoder layers
24
+ OUTPUT_IMAGE_SIZE: [896,896] # Output image resolution [height, width]
25
+ OUTPUT_CHANNELS: 3 # Number of output channels (3 for RGB diffuse image)
26
+ DECODER_LR: 0.0 # Custom learning rate for decoder (0.0 = frozen, 1.0 = same as base LR)
27
+ NUM_FUSION_BLOCKS_TRAINABLE: 1 # Number of fusion blocks to train (0-4, null = train all if DECODER_LR != 0)
28
+ TRAIN_RGB_HEAD: True # Whether to train RGB head (true/false, null = train if DECODER_LR != 0)
29
+ highlight:
30
+ FEATURE_DIM: 1024 # Feature dimension for highlight decoder
31
+ REASSEMBLE_OUT_CHANNELS: [96,192,384,768] # Output channels for each decoder stage
32
+ REASSEMBLE_FACTORS: [4.0, 2.0, 1.0, 0.5] # Spatial upsampling factors for each stage
33
+ READOUT_TYPE: "ignore" # Readout type for DPT decoder
34
+ USE_BN: False # Use batch normalization in decoder
35
+ DROPOUT: 0.1 # Dropout rate in decoder layers
36
+ OUTPUT_IMAGE_SIZE: [896,896] # Output image resolution [height, width]
37
+ OUTPUT_CHANNELS: 1 # Number of output channels (1 for highlight mask)
38
+ DECODER_LR: 5.0e-4 # Custom learning rate for decoder (0.0 = frozen, 1.0 = same as base LR)
39
+ NUM_FUSION_BLOCKS_TRAINABLE: null # Number of fusion blocks to train (0-4, null = train all if DECODER_LR != 0)
40
+ TOKEN_INPAINTER:
41
+ TOKEN_INPAINTER_CLASS: "TokenInpainter_Prior" # Token inpainter class name
42
+ TOKEN_INPAINTER_MODULE: "token_inpainters" # Module name to import token inpainter from
43
+ # FROM_PRETRAINED: "weights/token_inpainter.pth" # Path to pretrained token inpainter weights (optional)
44
+ TOKEN_INPAINTER_LR: 1.0e-4 # Learning rate for token inpainter (can differ from base LR)
45
+ DEPTH: 6 # Number of transformer blocks
46
+ HEADS: 16 # Number of attention heads
47
+ DROP: 0.05 # Dropout rate
48
+ USE_POSITIONAL_ENCODING: True # Enable 2D sinusoidal positional encodings
49
+ USE_FINAL_NORM: True # Enable final LayerNorm before output projection
50
+ USE_LOCAL_PRIOR: True # Blend local mean prior for masked seeds
51
+ LOCAL_PRIOR_WEIGHT: 0.5 # Weight for local prior blending (1.0 = only mask_token, 0.0 = only local mean)
52
+ LOCAL_PRIOR_KERNEL: 5 # Kernel size for local prior blending (> 1)
53
+ SEED_NOISE_STD: 0.02 # Standard deviation of noise added to masked seeds during training
54
+ INPAINT_MASK_DILATION:
55
+ value: 3 # Dilation kernel size (pixels) for inpaint mask - Must be odd
56
+ USE_TORCH_COMPILE: # Enable PyTorch 2.0 torch.compile for faster training (experimental)
57
+ value: False
58
+ DISTRIBUTE:
59
+ value: "ddp"
60
+
61
+ ### DATA
62
+ DATASETS:
63
+ value:
64
+ SCRREAM:
65
+ VAL_SCENES: ["scene10_full_00","scene11_full_00","scene044_full_00","scene04_reduced_00","scene04_reduced_01","scene04_reduced_02"] # List of validation scene names
66
+ TARGET_SIZE: [896,896] # Target image size [height, width] in pixels
67
+ RESIZE_MODE: "resize+crop" # Image resizing mode: "resize", "crop", "resize+crop", or "pad"
68
+ FEW_IMAGES: False # If True, load only first 10 images per scene (for quick debugging)
69
+ SAMPLE_EVERY_N: 2 # Load every Nth frame from each scene (1 = all frames, 4 = every 4th frame)
70
+ LOAD_RGB_ONLY: True # If True, ignore polarization data and load only RGB images
71
+
72
+ HOUSECAT6D:
73
+ VAL_SCENES: ["val_scene1","val_scene2"] # Validation scene names
74
+ TARGET_SIZE: [896,896] # Target image size [height, width]
75
+ RESIZE_MODE: "resize+crop" # Image resizing mode
76
+ FEW_IMAGES: False # Load only first 10 images if True
77
+ SAMPLE_EVERY_N: 2 # Load every Nth frame
78
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
79
+
80
+ CROMO:
81
+ TRAIN_SCENES: ["kitchen"] # Training scene names (list or string)
82
+ # VAL_SCENES: "station" # Validation scene names (optional)
83
+ TARGET_SIZE: [896,896] # Target image size [height, width]
84
+ RESIZE_MODE: "resize" # Image resizing mode
85
+ FEW_IMAGES: False # Load only first 10 images if True
86
+ SAMPLE_EVERY_N: 2 # Load every Nth frame
87
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
88
+
89
+ PSD:
90
+ TRAIN_SCENES: "PSD_Train" # Training scene name (string or list)
91
+ VAL_SCENES: "PSD_Val" # Validation scene name (string or list)
92
+ TARGET_SIZE: [896,896] # Target image size [height, width]
93
+ RESIZE_MODE: "resize+crop" # Image resizing mode
94
+ FEW_IMAGES: False # Load only first 10 images if True
95
+ SAMPLE_EVERY_N: 1 # Load every Nth frame (1 = all frames)
96
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
97
+
98
+ SCARED:
99
+ VAL_SCENES: ["v22","v23","v24","v25","v26","v27","v28","v29","v30","v31","v32","v33","v34"] # Validation scene names
100
+ TARGET_SIZE: [896,896] # Target image size [height, width]
101
+ RESIZE_MODE: "resize+crop" # Image resizing mode
102
+ SAMPLE_EVERY_N: 8 # Load every Nth frame
103
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
104
+ FEW_IMAGES: False # Load only first 10 images if True
105
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing in dataset
106
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection (0-1)
107
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
108
+ HIGHLIGHT_RECT_SIZE: [1000, 1000] # Size of highlight rectangle region [height, width]
109
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
110
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
111
+
112
+ STEREOMIS_TRACKING:
113
+ VAL_SCENES: ["P2_2"] # Validation scene names
114
+ TARGET_SIZE: [896,896] # Target image size [height, width]
115
+ RESIZE_MODE: "resize+crop" # Image resizing mode
116
+ SAMPLE_EVERY_N: 4 # Load every Nth frame
117
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
118
+ FEW_IMAGES: False # Load only first 10 imagas if True
119
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing
120
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection
121
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
122
+ HIGHLIGHT_RECT_SIZE: [800, 800] # Size of highlight rectangle region
123
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
124
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
125
+
126
+ CHOLEC80:
127
+ VAL_SCENES: ["val"] # Validation scene names
128
+ TARGET_SIZE: [896,896] # Target image size [height, width]
129
+ RESIZE_MODE: "resize+crop" # Image resizing mode
130
+ SAMPLE_EVERY_N: 10 # Load every Nth frame
131
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
132
+ FEW_IMAGES: False # Load only first 10 images if True
133
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing
134
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection
135
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
136
+ HIGHLIGHT_RECT_SIZE: [800, 800] # Size of highlight rectangle region
137
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
138
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
139
+
140
+ SUNRGBD:
141
+ VAL_SCENES: ["realsense"] # Validation scene names
142
+ TARGET_SIZE: [896,896] # Target image size [height, width]
143
+ RESIZE_MODE: "resize+crop" # Image resizing mode
144
+ SAMPLE_EVERY_N: 1 # Load every Nth frame
145
+ LOAD_RGB_ONLY: True # Ignore polarization data if True
146
+ FEW_IMAGES: False # Load only first 10 images if True
147
+ HIGHLIGHT_ENABLE: False # Enable highlight detection/processing
148
+ HIGHLIGHT_BRIGHTNESS_THRESHOLD: 0.9 # Brightness threshold for highlight detection
149
+ HIGHLIGHT_RETURN_MASK: True # Return highlight mask in dataset output
150
+ HIGHLIGHT_RECT_SIZE: [800, 800] # Size of highlight rectangle region
151
+ HIGHLIGHT_RETURN_RECT_AS_RGB: False # Return highlight rectangle as RGB if True
152
+ HIGHLIGHT_RETURN_RECT: True # Return highlight rectangle region if True
153
+
154
+
155
+ FEW_IMAGES_OVERRIDE:
156
+ value: False # If True, override all datasets' FEW_IMAGES to True (for quick debugging across all datasets)
157
+
158
+ BATCH_SIZE: # Max batch size with img size 896 is 32
159
+ value: 4 # Number of samples per batch (adjust based on GPU memory)
160
+ NUM_WORKERS:
161
+ value: 16 # Number of data loading worker processes (0 = main process only, "auto" = 90% of CPU affinity)
162
+ SHUFFLE:
163
+ value: True # Shuffle training data each epoch (False for validation/test)
164
+ PIN_MEMORY:
165
+ value: True # Pin memory in DataLoader for faster GPU transfer (recommended: True)
166
+ PREFETCH_FACTOR:
167
+ value: 2 # Number of batches to prefetch per worker (higher = more memory usage)
168
+
169
+ ### HIGHLIGHTS
170
+ MOGE_MODEL:
171
+ value: "Ruicheng/moge-2-vits-normal" # MoGe model name for normal estimation (HuggingFace format)
172
+ SURFACE_ROUGHNESS:
173
+ value: 8.0 # Blinn-Phong surface roughness exponent (higher = sharper highlights)
174
+ INTENSITY:
175
+ value: 2.0 # Specular highlight intensity multiplier
176
+ LIGHT_DISTANCE_RANGE:
177
+ value: [0.0, 1] # Range for light source distance sampling [min, max] (normalized)
178
+ LIGHT_LEFT_RIGHT_ANGLE:
179
+ value: [0, 360] # Range for light source horizontal angle [min, max] in degrees
180
+ LIGHT_ABOVE_BELOW_ANGLE:
181
+ value: [0, 360] # Range for light source vertical angle [min, max] in degrees
182
+ DATASET_HIGHLIGHT_DILATION:
183
+ value: 25 # Dilation kernel size (pixels) for dataset highlight masks
184
+ DATASET_HIGHLIGHT_THRESHOLD:
185
+ value: 0.9 # Brightness/luminance threshold (0-1) for detecting highlights in dataset images
186
+ DATASET_HIGHLIGHT_USE_LUMINANCE:
187
+ value: True # If True, use perceptually-weighted luminance (0.299*R + 0.587*G + 0.114*B) for dataset highlights; if False, use simple mean brightness
188
+ HIGHLIGHT_COLOR:
189
+ value: [1.0, 1.0, 1.0] # RGB color for synthetic highlights (normalized 0-1)
190
+ CLAMP_RECONSTRUCTION:
191
+ value: True # Clamp reconstructed images to [0, 1] range if True
192
+
193
+ ### OPTIMIZATION
194
+ LEARNING_RATE:
195
+ value: 1.0e-3 # Base learning rate for optimizer # DEPRECATED. SETTING LR FOR EACH MODULE ABOVE
196
+ WEIGHT_DECAY:
197
+ value: 0.0 # L2 regularization weight (0.0 = no weight decay)
198
+ EPOCHS:
199
+ value: 20 # Maximum number of training epochs
200
+ GRADIENT_ACCUMULATION_STEPS:
201
+ value: 1 # Number of steps to accumulate gradients before optimizer step (1 = no accumulation)
202
+ WARMUP:
203
+ value: 100 # Number of warmup steps for learning rate schedule (linear warmup from 0 to LR)
204
+ GRADIENT_CLIPPING_MAX_NORM:
205
+ value: 8 # Maximum gradient norm for clipping (set to -1 to disable clipping)
206
+ LR_SCHEDULER:
207
+ value:
208
+ ONPLATEAU: # ReduceLROnPlateau scheduler (reduces LR when validation metric plateaus)
209
+ PATIENCE: 5 # Number of epochs to wait before reducing LR
210
+ FACTOR: 0.1 # Factor by which LR is reduced (new_lr = old_lr * factor)
211
+ # COSINE: # CosineAnnealingLR scheduler (cosine annealing schedule)
212
+ # N_PERIODS: 5 # Number of cosine periods over training
213
+ STEPWISE: # StepLR scheduler (reduces LR at fixed step intervals)
214
+ N_STEPS: 4 # Number of times to reduce LR during training
215
+ GAMMA: 0.5 # Factor by which LR is reduced at each step (new_lr = old_lr * gamma)
216
+ # EXPONENTIAL: # ExponentialLR scheduler (exponential decay)
217
+ # GAMMA: 0.5 # Multiplicative factor for exponential decay
218
+
219
+ SWITCH_OPTIMIZER_EPOCH:
220
+ value: null # Epoch number to switch from bootstrap to refining optimizer (null = no switch)
221
+ OPTIMIZER_BOOTSTRAP_NAME:
222
+ value: "AdamW" # Optimizer name for initial training phase ("Adam", "SGD", etc.)
223
+ OPTIMIZER_REFINING_NAME:
224
+ value: "AdamW" # Optimizer name for refining phase (used after SWITCH_OPTIMIZER_EPOCH)
225
+ EARLY_STOPPING_PATIENCE:
226
+ value: 10 # Number of epochs without improvement before stopping training
227
+ SAVE_INTERVAL:
228
+ value: 1000 # Number of training steps between model checkpoints
229
+
230
+ DATASET_HIGHLIGHT_SUPERVISION_THRESHOLD:
231
+ value: 0.1 # Pixel highlights above this threshold (should be low) are excluded from supervision
232
+
233
+ ### LOSS WEIGHTS (relative to the total loss, NOT NORMALIZED LATER)
234
+ SPECULAR_LOSS_WEIGHT:
235
+ value: 0.0 # Weight for specular component reconstruction loss
236
+ DIFFUSE_LOSS_WEIGHT:
237
+ value: 0.0 # Weight for diffuse component reconstruction loss
238
+ HIGHLIGHT_LOSS_WEIGHT:
239
+ value: 1.0 # Weight for highlight mask regression loss
240
+ TOKEN_INPAINT_LOSS_WEIGHT:
241
+ value: 1.0 # Weight for token-space inpainting loss (L1 + cosine similarity in feature space)
242
+
243
+ IMAGE_RECONSTRUCTION_LOSS_WEIGHT:
244
+ value: 0.0 # Weight for full image reconstruction loss
245
+ SATURATION_RING_LOSS_WEIGHT:
246
+ value: 0.0 # Weight for saturation ring consistency loss (around highlight regions)
247
+ WEIGHT_CONTEXT_IDENTITY:
248
+ value: 0.0 # LEAVE TO 0.0: Weight for L1 loss on context (non-masked) regions (identity preservation)
249
+ WEIGHT_TV_IN_HOLE:
250
+ value: 0.0 # LEAVE TO 0.0: Weight for total variation loss inside masked/hole regions
251
+
252
+ RING_KERNEL_SIZE:
253
+ value: 11 # Kernel size (odd number) for saturation ring dilation around highlights
254
+ RING_VAR_WEIGHT:
255
+ value: 0.5 # Weight for variance matching in saturation ring loss (vs mean matching)
256
+ RING_TEXTURE_WEIGHT:
257
+ value: 1.0 # Weight for texture consistency term in saturation ring loss
258
+ HLREG_W_L1:
259
+ value: 1.0 # Weight for L1 loss in highlight regression
260
+ HLREG_USE_CHARB:
261
+ value: True # Use Charbonnier loss (smooth L1) instead of standard L1 if True
262
+ HLREG_W_DICE:
263
+ value: 0.2 # Weight for Dice loss in highlight regression (for mask overlap)
264
+ HLREG_W_SSIM:
265
+ value: 0.0 # Weight for SSIM loss in highlight regression
266
+ HLREG_W_GRAD:
267
+ value: 0.0 # Weight for gradient loss in highlight regression
268
+ HLREG_W_TV:
269
+ value: 0.0 # Weight for total variation loss in highlight regression
270
+ HLREG_BALANCE_MODE:
271
+ value: "auto" # Class balancing mode for highlight regression: 'none' | 'auto' | 'pos_weight'
272
+ HLREG_POS_WEIGHT:
273
+ value: 1.0 # Positive class weight (used only if BALANCE_MODE == 'pos_weight')
274
+ HLREG_FOCAL_GAMMA:
275
+ value: 2.0 # Focal loss gamma parameter (0.0 = standard BCE, 1.0-2.0 helps with gradient vanishing)
276
+
277
+
278
+ RING_DILATE_KERNEL:
279
+ value: 17 # Dilation kernel size (odd number) for creating ring mask around highlights
280
+ WEIGHT_SEAM:
281
+ value: 0.5 # Weight for gradient matching loss on saturation ring
282
+ SEAM_USE_CHARB:
283
+ value: True # Use Charbonnier loss instead of L1 in seam loss (smooth L1 for boundary consistency)
284
+ SEAM_WEIGHT_GRAD:
285
+ value: 0.0 # Weight for gradient matching term inside seam loss (0.0 = disable gradient term)
286
+ TOKEN_FEAT_ALPHA:
287
+ value: 0.5 # Mixing factor for token feature loss: alpha * L1 + (1-alpha) * (1-cosine_sim)
288
+
289
+ ### DIFFUSE HIGHLIGHT PENALTY
290
+ WEIGHT_DIFFUSE_HIGHLIGHT_PENALTY:
291
+ value: 0.1 # Weight for penalty loss on highlights in diffuse decoder output (0.0 = disabled)
292
+ DIFFUSE_HL_THRESHOLD:
293
+ value: 0.85 # Brightness/luminance threshold for detecting highlights in diffuse (0.0-1.0)
294
+ DIFFUSE_HL_USE_CHARB:
295
+ value: True # Use Charbonnier loss instead of L1 for diffuse highlight penalty
296
+ DIFFUSE_HL_PENALTY_MODE:
297
+ value: "brightness" # Penalty mode: "brightness" (penalize brightness/luminance above threshold) or "pixel" (penalize RGB values directly)
298
+ DIFFUSE_HL_TARGET_BRIGHTNESS:
299
+ value: null # Target brightness/luminance for penalized pixels (null = use threshold value)
300
+ DIFFUSE_HL_USE_LUMINANCE:
301
+ value: False # If True, use perceptually-weighted luminance (0.299*R + 0.587*G + 0.114*B); if False, use simple mean brightness
302
+
303
+ ### LOGGING, RESULTS AND WANDB
304
+ LOG_INTERVAL:
305
+ value: 1 # Number of training steps between console log outputs
306
+ WANDB_LOG_INTERVAL:
307
+ value: 1 # Number of training steps between WandB metric logs
308
+ IMAGE_LOG_INTERVAL:
309
+ value: 5 # Number of training steps between image logging to WandB
310
+ NO_WANDB:
311
+ value: False # Disable WandB logging if True (useful for local debugging)
312
+ MODEL_WATCHER_FREQ_WANDB:
313
+ value: 50 # Frequency (in steps) for logging model parameter histograms to WandB
314
+ WANDB_ENTITY:
315
+ value: "unreflect-anything" # WandB organization/entity name
316
+ WANDB_PROJECT:
317
+ value: "UnReflectAnything" # WandB project name
318
+ NOTES:
319
+ value: "" # Notes/description for this training run