Skip to content

Commit

Permalink
Merge branch 'master' into fix-deprecated-amp
Browse files Browse the repository at this point in the history
  • Loading branch information
Bala-Vignesh-Reddy authored Jan 13, 2025
2 parents 0a9d00d + 6420a1d commit f78179a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,9 @@ def forward(self, im, augment=False, visualize=False):
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

Expand Down

0 comments on commit f78179a

Please sign in to comment.