glenn-jocher
commited on
Commit
•
b884ea3
1
Parent(s):
6445a81
Simplify TF normalized to pixels (#6494)
Browse files- models/common.py +1 -4
models/common.py
CHANGED
@@ -446,10 +446,7 @@ class DetectMultiBackend(nn.Module):
|
|
446 |
if int8:
|
447 |
scale, zero_point = output['quantization']
|
448 |
y = (y.astype(np.float32) - zero_point) * scale # re-scale
|
449 |
-
y[...,
|
450 |
-
y[..., 1] *= h # y
|
451 |
-
y[..., 2] *= w # w
|
452 |
-
y[..., 3] *= h # h
|
453 |
|
454 |
y = torch.tensor(y) if isinstance(y, np.ndarray) else y
|
455 |
return (y, []) if val else y
|
|
|
446 |
if int8:
|
447 |
scale, zero_point = output['quantization']
|
448 |
y = (y.astype(np.float32) - zero_point) * scale # re-scale
|
449 |
+
y[..., :4] *= [w, h, w, h] # xywh normalized to pixels
|
|
|
|
|
|
|
450 |
|
451 |
y = torch.tensor(y) if isinstance(y, np.ndarray) else y
|
452 |
return (y, []) if val else y
|