Skip to content

Commit

Permalink
Enabled multitask with weights 1, 1 ultralytics#5
Browse files Browse the repository at this point in the history
  • Loading branch information
manole-alexandru committed Mar 23, 2023
1 parent bef3e29 commit a93dfbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/loss.py
Expand Up @@ -185,7 +185,7 @@ def __call__(self, preds, targets, seg_masks): # predictions, targets

# return (lbox + lobj + lcls) * bs, torch.cat((lbox, lobj, lcls)).detach()
# return total_loss, torch.cat((lbox, lobj, lcls, lseg)).detach()
return (lbox + lobj + lcls) * bs * 0, lseg * bs * 1, torch.cat((lbox, lobj, lcls, lseg)).detach()
return (lbox + lobj + lcls) * bs * 1, lseg * bs * 1, torch.cat((lbox, lobj, lcls, lseg)).detach()

def build_targets(self, p, targets):
# Build targets for compute_loss(), input targets(image,class,x,y,w,h)
Expand Down

0 comments on commit a93dfbf

Please sign in to comment.