Problem description: When using yolov5 to run the target detection model, the error "Class labels must be a dictionary of numbers to string" is reported because the class labels do not match.
Solution:
1. Find the names in helmet.yaml in the data directory, as shown below:
code show as below:
names:
0:helmet
1: nohelmet
2. Modify the names in step 1 as shown below:
code show as below:
names:['helmet','nohelmet']
At this point, the problem is solved! ! !