Fix TFLite Segment mask rows 1-4 normalization (#9405)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
30a867b8d7
commit
007f778b72
1 changed files with 1 additions and 1 deletions
|
|
@ -543,7 +543,7 @@ class AutoBackend(nn.Module):
|
|||
if integer:
|
||||
scale, zero_point = output["quantization"]
|
||||
x = (x.astype(np.float32) - zero_point) * scale # re-scale
|
||||
if x.ndim > 2: # if task is not classification
|
||||
if x.ndim == 3: # if task is not classification, excluding masks (ndim=4) as well
|
||||
# Denormalize xywh by image size. See https://github.com/ultralytics/ultralytics/pull/1695
|
||||
# xywh are normalized in TFLite/EdgeTPU to mitigate quantization error of integer models
|
||||
x[:, [0, 2]] *= w
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue