JdeRobot / JdeRobot/PerceptionMetrics

[Bug]: ModuleNotFoundError due to supervision API change

Open
#489 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
112
Forks
109
PR merge metrics
No merged PRs in 30d

Description

### 📌 Description
The application crashes at runtime due to an import error from the `supervision` library.
The module `supervision.detection.annotate` is no longer available in recent versions.

### ❗ Error Trace
`ModuleNotFoundError: No module named 'supervision.detection.annotate'`

**Traceback**:

```
File "/home/hatem/PerceptionMetrics/app.py", line 385, in
dataset_viewer_tab()
File "/home/hatem/PerceptionMetrics/tabs/dataset_viewer.py", line 13, in dataset_viewer_tab
from supervision.detection.annotate import BoxAnnotator
```

**Root Cause**

Recent versions of supervision introduced a breaking API change and removed:
`supervision.detection.annotate`

Classes like BoxAnnotator were moved to the top-level module.

**🔧 Suggested Fix**
Update the import statement:
Old (deprecated / broken)
`from supervision.detection.annotate import BoxAnnotator`

**New (supported)**
`from supervision import BoxAnnotator`

or:

import supervision as sv

`box_annotator = sv.BoxAnnotator()`

**Workaround**
Pin an older version of the library:
`pip install supervision==0.6.0`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.