The main.py script serves as the entrypoint for training and evaluating Deformable DETR models. It uses argparse to manage a wide range of hyperparameters for the backbone, transformer, loss functions, and dataset loading.
Key configuration categories include:
- Optimizer/Learning Rate: Control
--lr, --lr_backbone, --lr_linear_proj_mult, and switch to SGD using --sgd. - Model Architecture: Select
--backbone (e.g., resnet50), set --num_feature_levels, and configure transformer layers via --enc_layers and --dec_layers. - Training Control: Set
--epochs, --batch_size, --output_dir, and --resume to load checkpoints. - Task Variants: Enable segmentation with
--masks or use --two_stage / --with_box_refine variants. - Dataset: Specify
--dataset_file (e.g., coco) and --coco_path.