Skip to content

Commit

Permalink
Simplify TF normalized to pixels (ultralytics#6494)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Feb 1, 2022
1 parent c0f078c commit f249f1d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,7 @@ def forward(self, im, augment=False, visualize=False, val=False):
if int8:
scale, zero_point = output['quantization']
y = (y.astype(np.float32) - zero_point) * scale # re-scale
y[..., 0] *= w # x
y[..., 1] *= h # y
y[..., 2] *= w # w
y[..., 3] *= h # h
y[..., :4] *= [w, h, w, h] # xywh normalized to pixels

y = torch.tensor(y) if isinstance(y, np.ndarray) else y
return (y, []) if val else y
Expand Down

0 comments on commit f249f1d

Please sign in to comment.