about the loss function #2569
Unanswered
hunterchenghx
asked this question in
Q&A
Replies: 1 comment 4 replies
-
@hunterchenghx yes that's correct! If an object is not fit to any anchors then all of the anchor objectness truth values will be set to 0. This is why it's important to evolve good anchors, so that your Best Possible Recall (BPR) is high, and few objects are missed for training. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I read your loss.py carefully, and I've got questions about your build_target function.
I think you just select the target object whose bbox is related to your pre-set anchor boxes' size due to your hyp['anchor_t'], and just set these objects as your groundtruth to calculate the bbox loss, class loss and objectness loss. How about the object that is not fit with your anchors?
Also, I thought you select the nearby 3 grids for one target object, as these part of code described,
j, k = ((gxy % 1. < g) & (gxy > 1.)).T l, m = ((gxi % 1. < g) & (gxi > 1.)).T j = torch.stack((torch.ones_like(j), j, k, l, m)) t = t.repeat((5, 1, 1))[j]
but if the object is just sit on the boundary, it will duplicate the same grid (ex., it's j is True while l is also True). In that case, it will generate one more target, which will resulted in the loss. Am I correct?
Beta Was this translation helpful? Give feedback.
All reactions