name -> class ID mapping should be loaded from `YOLO().names`
Instead of loading the id2name from a JSON file, it should be loaded from the model.
Each ultralytics checkpoint contains the id2name, which is accessible using:
model = YOLO('path/to/weights')
id2name = model.names
That way, the id2name will always corresond to the mapping used during training.
Additionally, this will allow to use pre-trained models without the need for supplying the id2name json.