git clone https://github.com/facebookresearch/dinov3.git
cd dinov3
pip install -e .pip install opencv-python
pip install pandas
pip install numpy
pip install scikit-learn
pip install matplotlib
pip install seaborn
pip install lightning项目使用YAML配置文件进行参数管理。默认配置文件位于 configs/default.yaml:
lr: 1e-4
max_epochs: 30
batch_size: 64
num_workers: 12
dataset:
train_path: "/path/to/train/data"
val_path: "/path/to/val/data"
train_ann: "/path/to/train/annotations.json"
val_ann: "/path/to/val/annotations.json"
min_bbox_area: 400
backbone_weights: "/path/to/pretrained/weights.pth"# 使用默认配置训练
python trainer.py --config configs/default.yaml
# 覆盖特定参数
python trainer.py --config configs/default.yaml --batch_size 32 --lr 5e-5
# 使用测试配置
python trainer.py --config configs/test.yaml基于一阶段DINO目标检测模型生成数据集
python make/stage1_predict_dataset.py /path/to/model /path/to/datasetlr: 学习率 (默认: 1e-4)max_epochs: 最大训练轮数 (默认: 30)batch_size: 批次大小 (默认: 64)num_workers: 数据加载线程数 (默认: 12)
train_path: 训练数据路径val_path: 验证数据路径train_ann: 训练标注文件路径val_ann: 验证标注文件路径min_bbox_area: 最小边界框面积阈值
backbone_weights: 预训练权重路径freeze_backbone: 是否冻结骨干网络 (默认: True)