Description
When I run inference with my segmentation model through ModelAPI v0.4.6, all the predicted labels are wrong and seemingly off-by-1 w.r.t. the order of labels encoded in the model .xml.
Steps to reproduce
- Download this demo archive - it contains a model, sample image and demo code to reproduce the bug
- View the
pyproject.toml -> it's configured to download the latest version of MAPI from develop
- Run
uv run demo.py
- View the predictions (
result.jpg)
- Now re-open
pyproject.toml and comment out L23 (# openvino-model-api = { git = ...): this change will force uv to source the official version of MAPI released in Pypi (0.4.5)
- Run
uv run demo.py
- View the predictions (
result.jpg)
When running on the official 0.4.5 (step 6), all predictions and their labels seem correct.
Conversely, when doing inference with the latest unreleased MAPI (step 3), all labels are wrong.
From the model.xml we can see the order of the labels:
<label_ids value="None 0 1 2 3 4 5 6 7 8" />
<labels value="getitune_empty_lbl Ball Hoop Human_Ref Period Player Shot_Clock Team_Name Team_Points Time_Left" />
If we compare this order to what we see in the image:
- Ball corresponds to
label_ids=0, but it's predicted as the empty label (label_ids=None)
- Hoop corresponds to
label_ids=1, but it's predicted as the ball (label_ids=0)
- Human ref corresponds to
label_ids=2, but it's predicted as hoop (label_ids=1)
- and so on
Description
When I run inference with my segmentation model through ModelAPI v0.4.6, all the predicted labels are wrong and seemingly off-by-1 w.r.t. the order of labels encoded in the model
.xml.Steps to reproduce
pyproject.toml-> it's configured to download the latest version of MAPI from developuv run demo.pyresult.jpg)pyproject.tomland comment out L23 (# openvino-model-api = { git = ...): this change will force uv to source the official version of MAPI released in Pypi (0.4.5)uv run demo.pyresult.jpg)When running on the official 0.4.5 (step 6), all predictions and their labels seem correct.
Conversely, when doing inference with the latest unreleased MAPI (step 3), all labels are wrong.
From the
model.xmlwe can see the order of the labels:If we compare this order to what we see in the image:
label_ids=0, but it's predicted as the empty label (label_ids=None)label_ids=1, but it's predicted as the ball (label_ids=0)label_ids=2, but it's predicted as hoop (label_ids=1)