Skip to content

QoL improvements - #12

Merged
mateusz29 merged 6 commits into
masterfrom
develop
Jul 11, 2026
Merged

QoL improvements#12
mateusz29 merged 6 commits into
masterfrom
develop

Conversation

@mateusz29

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 11, 2026 16:02
@mateusz29
mateusz29 merged commit 23bec2a into master Jul 11, 2026
2 of 3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates training/dataset configuration defaults and adds tooling/dependency changes to support improved workflows (including RF-DETR ONNX export and dataset preparation).

Changes:

  • Switch training/config references to MSGOv1 (YOLO + RF-DETR) and update DFine run settings.
  • Add ONNX export-related dependencies (via rfdetr extras) and update uv.lock accordingly.
  • Update dataset YAML class mappings and add/adjust notebooks and ignore rules.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
uv.lock Adds lock entries for ONNX export-related dependencies and rfdetr extra resolution.
src/yolo/train.py Points YOLO training to MSGOv1 and increases training epochs.
src/rf-detr/train.py Updates dataset location to MSGOv1 and adds a clarifying import comment.
src/dfine/custom_d_fine-main/config.yaml Adjusts experiment name and toggles only_eval off.
src/data_processing/dataset_utils.py Updates the hardcoded dataset path used in the __main__ entrypoint.
pyproject.toml Changes the rfdetr dependency to include the onnxexport extra.
notebooks/03_convert_model.ipynb Adds an ONNX conversion notebook for RF-DETR models.
notebooks/02_dataset_combination.ipynb Updates dataset combination notebook (including spelling fix and refactors).
dataset/DOTAv2.yaml Corrects dataset metadata, val path, and class names.
dataset/DIOR.yaml Corrects dataset metadata and class names.
.gitignore Ignores trained_models/ and old_MSGOv1/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 172 to +176
# rename_files("D:\\stuff\\datasets\\MSGOv2\\MSGOv2")
# move_png_files("D:\\stuff\\datasets\\MSGOv2\\MSGOv2\\sliced\\val")
# delete_empty_images("D:\\stuff\\datasets\\MSGOv2\\MSGOv2")
# delete_some_empty_images("D:\\stuff\\datasets\\MSGOv2\\MSGOv2\\sliced")
make_split_csv("D:\\studia\\magisterka\\satellite-object-detection\\dataset\\MSGOv1")
make_split_csv("D:\\stuff\\datasets\\MSGOv1\\MSGOv1")
Comment thread src/yolo/train.py
Comment on lines 7 to 11
def train_yolo_model():
MODEL_NAME = "../../pretrained_models/yolo12n.pt"

EPOCHS = 2
EPOCHS = 100
BATCH_SIZE = 8
Comment thread pyproject.toml
Comment on lines 21 to +25
"opencv-python>=4.11.0.86",
"packaging>=25.0",
"pillow>=11.3.0",
"pyyaml>=6.0.2",
"rfdetr>=1.2.1",
"rfdetr[onnxexport]>=1.2.1",
Comment on lines +90 to +94
"model = RFDETRMedium(\n",
" pretrain_weights=\"D://studia//magisterka//satellite-object-detection//trained_models//rfdetr_medium_best.pth\"\n",
")\n",
"\n",
"model.export(output_dir=\"C://Users//mati//Downloads//rfdetr_medium_best\")"
Comment on lines +161 to +165
"model = RFDETRLarge(\n",
" pretrain_weights=\"D://studia//magisterka//satellite-object-detection//trained_models//rfdetr_large_best.pth\"\n",
")\n",
"\n",
"model.export(output_dir=\"C://Users//mati//Downloads//rfdetr_large_best\")"
Comment on lines +234 to +238
"model = RFDETRSmall(\n",
" pretrain_weights=\"D://studia//magisterka//satellite-object-detection//trained_models//rfdetr_small_best.pth\"\n",
")\n",
"\n",
"model.export(output_dir=\"C://Users//mati//Downloads//rfdetr_small_best\")"
"id": "7155af06",
"metadata": {},
"source": [
"### Create seperate DIOR and DOTAv2 datasets with correct objects"
Comment on lines 440 to 442
"source": [
"def check_distribution(paths, image_to_counts_map, num_classes):\n",
" total_counts = np.zeros(num_classes, dtype=int)\n",
" for path in paths:\n",
" counts = image_to_counts_map.get(path, {})\n",
" for class_id, count in counts.items():\n",
" total_counts[class_id] += count\n",
" return total_counts\n",
"\n",
"\n",
"train_counts = check_distribution(X_train_paths, image_to_counts, NUM_CLASSES)\n",
"val_counts = check_distribution(X_val_paths, image_to_counts, NUM_CLASSES)\n",
"test_counts = check_distribution(X_test_paths, image_to_counts, NUM_CLASSES)\n",
"total_counts = train_counts + val_counts + test_counts\n",
"\n",
"print(f\"Class Names: {list(MSGO_CLASSES.keys())}\")\n",
"print(f\"Total Instances: {total_counts}\")\n",
"print(f\"Train Instances: {train_counts} ({(train_counts / total_counts * 100).round(1)}%)\")\n",
"print(f\"Val Instances: {val_counts} ({(val_counts / total_counts * 100).round(1)}%)\")\n",
"print(f\"Test Instances: {test_counts} ({(test_counts / total_counts * 100).round(1)}%)\")"
"X_train_paths, X_val_paths, X_test_paths = create_splits(\"D:\\\\stuff\\\\datasets\\\\MSGOv1\\\\combined\")"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants