Skip to content

Commit

Permalink
fix/hyper
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Oct 15, 2020
1 parent 4d3680c commit c40dcc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from contextlib import contextmanager
from copy import copy
from pathlib import Path
from warnings import warn

import cv2
import matplotlib
Expand Down Expand Up @@ -529,6 +530,9 @@ def compute_loss(p, targets, model): # predictions, targets, model
lobj += BCEobj(pi[..., 4], tobj) * balance[i] # obj loss

s = 3 / np # output count scaling
if 'box' not in h:
warn('Compatibility your hyper confing is missing "box" which was renamed from past "giou".')
h['box'] = h.pop('giou')
lbox *= h['box'] * s
lobj *= h['obj'] * s * (1.4 if np == 4 else 1.)
lcls *= h['cls'] * s
Expand Down

0 comments on commit c40dcc9

Please sign in to comment.