I just want to get class data in my python script like: person, car, truck, dog but my output more than this. Also I can not use results as a string.
Python script:
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
results = model.predict(source="0")
Output:
0: 480x640 1 person, 1 car, 7.1ms
0: 480x640 1 person, 1 car, 7.2ms
0: 480x640 1 person, 1 car, 7.1ms
0: 480x640 1 person, 1 car, 7.1ms
0: 480x640 1 person, 1 car, 7.1ms
0: 480x640 1 person, 7.9ms
0: 480x640 1 person, 7.1ms
0: 480x640 1 person, 1 car, 7.1ms
0: 480x640 1 person, 1 car, 7.1ms