Skip to content

Ultralytics results not properly checked in Detections.from_ultralytics #2000

@mabe56

Description

@mabe56

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")".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions