mmdiff / configs /pascal_voc_config.yaml
multimodalart's picture
multimodalart HF Staff
Upload folder using huggingface_hub
2267636 verified
Raw
History Blame Contribute Delete
3.66 kB
# Pascal VOC Training Configuration - Native Resolution (Variable Resolution with FluxResizer)
# Uses FLUX.1-dev and FluxResizer for optimal native resolutions (no padding)
# Experiment settings
experiment:
name: "pascal_voc_native_resolution"
description: "Pascal VOC with FLUX.1-dev at native resolutions using FluxResizer"
# Concept configurations (same as original)
concepts:
basic: ["object", "background", "detail", "edges"]
meta: ["living", "vehicle", "furniture", "object", "background"]
meta_expanded: ["living", "vehicle", "furniture", "object", "background", "person", "car", "airplane", "table", "plant", "bird", "bicycle"]
combined: ["object", "background", "living", "vehicle", "furniture", "detail", "edges"]
with_classes: ["object", "background", "detail", "edges", "airplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "table", "dog", "horse", "motorbike", "person", "plant", "sheep", "sofa", "train", "television"]
all_comprehensive: ["living", "vehicle", "furniture", "object", "background", "detail", "edges", "airplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "table", "dog", "horse", "motorbike", "person", "plant", "sheep", "sofa", "train", "television"]
# Training settings
training:
concept_config: "basic" # Which concept configuration to use
epochs: 100 # Match baseline (was 20)
learning_rate: 1e-4 # Match baseline (capped at 3e-5 in optimizer code)
batch_size: 1 # REQUIRED: Must be 1 for variable resolution
accumulate_grad_batches: 4 # Effective batch size = 4
gradient_clip_val: 0.5
precision: "16-mixed"
# Data settings
data:
dataset: "pascal_voc"
data_root: "${VOC_ROOT}" # dir holding JPEGImages/
train_split_file: "${VOC_SPLITS}/train_aug.txt"
val_split_file: "${VOC_SPLITS}/val.txt"
mask_root: "${VOC_MASKS}" # dir holding SegmentationClassAug/ (masks)
num_classes: 21
# NOTE: No target_size! FluxResizer selects optimal resolution per image
# Model settings
model:
flux_model: "black-forest-labs/FLUX.1-dev" # Changed from schnell to dev
dtype: "float16"
dino_model: "dinov3_vitb16" # DINOv3 base model
feature_locations:
transformer_blocks: [4, 9, 13, 18]
single_transformer_blocks: [4, 15, 26, 37]
decoder:
features: 256
hyperfeature_fusion:
num_timesteps: 4
fusion_type: "transformer"
hidden_dim: 768
num_transformer_layers: 3
layer_scale_init: 1e-6
# FLUX settings
flux:
timesteps: 28
guidance_scale: 3.5
num_inference_steps: 1
concept_timesteps: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]
concept_layers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
# Hardware settings
hardware:
devices: 1 # Use 2 GPUs for faster training
#strategy: "ddp_find_unused_parameters_true" # Multi-GPU strategy
num_sanity_val_steps: 1
detect_anomaly: true
accelerator: "gpu"
# Paths (timestamps will be automatically added)
paths:
# All outputs live under ${MMDIFF_OUTPUT} (set it to a writable dir, e.g. /work/<user>/mmdiff_out).
cache_base_dir: "${MMDIFF_OUTPUT}/cache"
log_base_dir: "${MMDIFF_OUTPUT}/logs"
checkpoint_base_dir: "${MMDIFF_OUTPUT}/checkpoints"
use_timestamp: true
permanent_cache_dir: "${MMDIFF_OUTPUT}/cache/pascal_feature_cache" # Native resolution feature cache
# Logging
logging:
log_every_n_steps: 10
save_top_k: 3
monitor: "val_loss"
mode: "min"
# HuggingFace
huggingface:
token: "" # Leave empty and authenticate via `huggingface-cli login` or the HF_TOKEN env var