Update DetectMultiBackend for tuple outputs 2 (#9275)
* Update DetectMultiBackend for tuple outputs 2 Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> * Update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update * Update * Update Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
96c3c7f71d
commit
7aa263c5f2
3 files changed
+12
-7
No files matched your search
@@ -204,11 +204,11 @@ def run(
|
||||
|
||||
# Inference
|
||||
with dt[1]:
|
||||
out, train_out = model(im) if training else model(im, augment=augment, val=True) # inference, loss outputs
|
||||
out, train_out = model(im) if compute_loss else (model(im, augment=augment), None)
|
||||
|
||||
# Loss
|
||||
if compute_loss:
|
||||
loss += compute_loss([x.float() for x in train_out], targets)[1] # box, obj, cls
|
||||
loss += compute_loss(train_out, targets)[1] # box, obj, cls
|
||||
|
||||
# NMS
|
||||
targets[:, 2:] *= torch.tensor((width, height, width, height), device=device) # to pixels
|
||||
|
||||
Reference in new issue
Block a user