YOLOv8 Baseline {Train & Inference}

#11
by NischayDnk - opened

I have made my currently solution public which includes the training and inference pipeline for the competition using recently launched YOLOv8 models.

Here is the GitHub Repo Link, follow the instructions in Readme to run the baseline.
https://github.com/Nischaydnk/hf-shipdetection_baseline

Current settings:

  • Architecture: Yolov8n
  • Split: 200 images train, 56 images validation
  • Cv MAP score --> 0.259, LB --> 0.252

Seeing current high Leaderboard scores, I think larger Image size could enhance the score. I will make few experiments and update the results in this thread.

Also added some cool slider functions in the Notebook to visualize train/test predictions ๐Ÿค“๐Ÿค“

image.png

NischayDnk changed discussion title from YOLOv8 Baseline end-to-end notebook to YOLOv8 Baseline {Train & Inference}

Also, thanks for hosting interesting challenge @abhishek and Data-Driven Science Team.

Thank you for participating in this competition @NischayDnk and also for making your solution public โ€“ that's great!

Hey @NischayDnk
I used the following procedure to create the dataset
https://www.kaggle.com/code/pathikghugare/data-prep-ship-detection

created a yaml file like this :

train: /kaggle/input/ship-detection-hugging-face/ship-detection/train
val: /kaggle/input/ship-detection-hugging-face/ship-detection/test
nc: 1
names: ['ship']

then I simply trained the model

from ultralytics import YOLO
from YOLOv8_tools.wandb_callback import callbacks

# Load a model
model = YOLO("yolov8n.pt")  # load a pretrained model (recommended for training)

# Use the model
model.train(data="/kaggle/working/data.yaml", epochs=50, patience=10, batch=4, imgsz=1280, save_period=5, project="ship-detection", name="yolov8n", exist_ok=True)  # train the model

but in the validation stage I get the following:

Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
     2/10      15.5G      3.589      12.62      3.314          7       1280: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 4/4 [00:22<00:00,  5.74s/it]
Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 48/48 [01:33<00:00,  1.96s/it]
      all        383        766          0          0          0          0

i.e. P, R and mAP score is 0
I suspect that something is wrong with the code that prepared the data, but I can't figure out where I went wrong; could you please take a look?

Sign up or log in to comment