Fix TFLite Segment inference (#13488)
* Fix TFLite Segment inference * Auto-format by https://ultralytics.com --------- Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
1 parent
86fd1ab270
commit
6420a1db87
5 files changed
+17
-12
No files matched your search
@@ -750,6 +750,9 @@ class DetectMultiBackend(nn.Module):
|
||||
scale, zero_point = output["quantization"]
|
||||
x = (x.astype(np.float32) - zero_point) * scale # re-scale
|
||||
y.append(x)
|
||||
if len(y) == 2: # segment with (det, proto) output order reversed
|
||||
if len(y[1].shape) != 4:
|
||||
y = list(reversed(y)) # should be y = (1, 116, 8400), (1, 160, 160, 32)
|
||||
y = [x if isinstance(x, np.ndarray) else x.numpy() for x in y]
|
||||
y[0][..., :4] *= [w, h, w, h] # xywh normalized to pixels
|
||||
|
||||
|
||||
Reference in new issue
Block a user