In Detections.from_ultralytics the ultralytics_results is checked if it has the attrbute "boxes". But the statements after this if block directly access the boxes attribute, see.
|
class_id = ultralytics_results.boxes.cls.cpu().numpy().astype(int) |
These statements should also be guarded with "if hasattr(ultralytics_results, "boxes")".