Conversation
There was a problem hiding this comment.
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
rfdetrextras) and updateuv.lockaccordingly. - 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 on lines
7
to
11
| def train_yolo_model(): | ||
| MODEL_NAME = "../../pretrained_models/yolo12n.pt" | ||
|
|
||
| EPOCHS = 2 | ||
| EPOCHS = 100 | ||
| BATCH_SIZE = 8 |
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\")" | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.