Skip to content

Commit

Permalink
model names in PW_FT_detection changed for consistency with PytorchWi…
Browse files Browse the repository at this point in the history
…ldlife
  • Loading branch information
danielaruizl1 committed Jan 26, 2025
1 parent f903c9c commit 1bb057f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions PW_FT_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ Below you find the models that you can use for fine-tuning, along with their res

|Model|Name|License|
|---|---|---|
|MegaDetectroV6-Ultralytics-YoloV9-Compact|MDV6-yolov9c|AGPL-3.0|
|MegaDetectorV6-Ultralytics-YoloV9-Extra|MDV6-yolov9e|AGPL-3.0|
|MegaDetectorV6-Ultralytics-YoloV10-Compact|MDV6-yolov10n|AGPL-3.0|
|MegaDetectorV6-Ultralytics-YoloV10-Extra|MDV6-yolov10x|AGPL-3.0|
|MegaDetectorV6-Ultralytics-RtDetr-l|MDV6-rtdetrl|AGPL-3.0|
|MegaDetectroV6-Ultralytics-YoloV9-Compact|MDV6-yolov9-c|AGPL-3.0|
|MegaDetectorV6-Ultralytics-YoloV9-Extra|MDV6-yolov9-e|AGPL-3.0|
|MegaDetectorV6-Ultralytics-YoloV10-Compact|MDV6-yolov10-c|AGPL-3.0|
|MegaDetectorV6-Ultralytics-YoloV10-Extra|MDV6-yolov10-e|AGPL-3.0|
|MegaDetectorV6-Ultralytics-RtDetr-Compact|MDV6-rtdetr-c|AGPL-3.0|

## Configuration

Before training your model, you need to configure the training and data parameters in the `config.yaml` file. Here's a brief explanation of the parameters to help both technical and non-technical users understand their purposes:

- **General Parameters:**
- `model`: The type of model used (YOLO or RTDETR). Default: YOLO
- `model_name`: The name of the model [see availbale names here](#detection-models-available-for-finetuning). Default: MDV6-yolov9e.pt
- `model_name`: The name of the model [see availbale names here](#detection-models-available-for-finetuning). Default: MDV6-yolov9-e.pt
- `data`: Path to the dataset configuration file. Default: ./data/data_example.yaml
- `test_data`: Path to the test data directory. Default: ./data/data_example/images/test
- `task`: The task to perform (train, validation or inference). Default: train
Expand Down
6 changes: 3 additions & 3 deletions PW_FT_detection/config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# General
model: RTDETR #YOLO or RTDETR
model_name: MDV6-rtdetrl
model: YOLO #YOLO or RTDETR
model_name: MDV6-yolov9-e
data: ./data/data_example.yaml
test_data: ./data/data_example/images/test
task: train
exp_name: MDV6-yolov9e
exp_name: MDV6-yolov9-e

# Train
epochs: 20
Expand Down
12 changes: 6 additions & 6 deletions PW_FT_detection/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

def get_model_path(model):

if model == "MDV6-yolov9c":
if model == "MDV6-yolov9-c":
url = "https://zenodo.org/records/14567879/files/MDV6b-yolov9c.pt?download=1"
model_name = "MDV6b-yolov9c.pt"
elif model == "MDV6-yolov9e":
elif model == "MDV6-yolov9-e":
url = "https://zenodo.org/records/14567879/files/MDV6-yolov9e.pt?download=1"
model_name = "MDV6-yolov9e.pt"
elif model == "MDV6-yolov10n":
elif model == "MDV6-yolov10-c":
url = "https://zenodo.org/records/14567879/files/MDV6-yolov10n.pt?download=1"
model_name = "MDV6-yolov10n.pt"
elif model == "MDV6-yolov10x":
elif model == "MDV6-yolov10-e":
url = "https://zenodo.org/records/14567879/files/MDV6-yolov10x.pt?download=1"
model_name = "MDV6-yolov10x.pt"
elif model == "MDV6-rtdetrl":
elif model == "MDV6-rtdetr-c":
url = "https://zenodo.org/records/14567879/files/MDV6b-rtdetrl.pt?download=1"
model_name = "MDV6b-rtdetrl.pt"
else:
raise ValueError('Select a valid model version: yolov9c, yolov9e, yolov10n, yolov10x or rtdetrl')
raise ValueError('Select a valid model version: MDV6-yolov9-c, MDV6-yolov9-e, MDV6-yolov10-c, MDV6-yolov10-e or MDV6-rtdetr-c')

if not os.path.exists(os.path.join(torch.hub.get_dir(), "checkpoints", model_name)):
os.makedirs(os.path.join(torch.hub.get_dir(), "checkpoints"), exist_ok=True)
Expand Down

0 comments on commit 1bb057f

Please sign in to comment.