meituan / YOLOv6

YOLOv6: a single-stage object detection framework dedicated to industrial applications.
GNU General Public License v3.0
5.69k stars 1.03k forks source link

Even though specify the correct class name and mapping data.yaml ,Model detecting and labeling random class #409

Closed thangarajdeivasikamani closed 2 years ago

thangarajdeivasikamani commented 2 years ago

Hi, I have used the below dataset for object detection: https://www.kaggle.com/datasets/ashfakyeafi/road-vehicle-images-dataset

I have created dataset folder as below: image

Data_1.yaml prepared as below:

image

Class: ['ambulance', 'army vehicle', 'auto rickshaw', 'bicycle', 'bus', 'car', 'garbagevan', 'human hauler', 'minibus', 'minivan', 'motorbike', 'pickup', 'policecar', 'rickshaw', 'scooter', 'suv', 'taxi', 'three wheelers -CNG-', 'truck', 'van', 'wheelbarrow']

Training command I have used :

training with single GPU support

!python tools/train.py --batch 32 --conf configs/yolov6s.py --epochs 200 --data /content/drive/MyDrive/YOLO_6_Custom/dataset/trafic_data/data_1.yaml --device 0

Around 75 Epocs completed:

image

After that I have done the inference as below:

!python tools/infer.py --weights /content/drive/MyDrive/YOLO_6_Custom/YOLOv6/runs/train/exp/weights/best_ckpt.pt --source /content/drive/MyDrive/YOLO_6_Custom/dataset/trafic_data/images/test --device 0

But I am getting wrong prediction labels:

image

mtjhl commented 2 years ago

Please check if the index of the labels is the same with your labels.

['ambulance', 'army vehicle', 'auto rickshaw', 'bicycle', 'bus', 'car', 'garbagevan', 'human hauler', 'minibus', 'minivan', 'motorbike', 'pickup', 'policecar',
'rickshaw', 'scooter', 'suv', 'taxi', 'three wheelers -CNG-', 'truck', 'van', 'wheelbarrow']

For example , army vehicle label's index is 1, is it 1 in the txt format labels?

thangarajdeivasikamani commented 2 years ago

Hi, The same data set and labeling working in YOLO V5.And also refer the attached detection screenshot. I am not sure whether the model get the labels examples Horse, Fire hydrant,etc

mtjhl commented 2 years ago

If YOLOv6 and v5 all have same problem, the class index maybe is wrong. You'd better visualize the index on image, to see if the index is wrong.

danielchua2602 commented 2 years ago

try including --yaml /content/drive/MyDrive/YOLO_6_Custom/dataset/trafic_data/data_1.yaml when running your inference

thangarajdeivasikamani commented 2 years ago

@danielchua2602 Thanks now working