ultralytics 8.0.56
PyTorch 2.0 support and minor fixes (#1538)
Co-authored-by: N-Friederich <127681326+N-Friederich@users.noreply.github.com> Co-authored-by: Uhrendoktor <36703334+Uhrendoktor@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Aman Agarwal <amanag.11@gmail.com> Co-authored-by: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com> Co-authored-by: Nadav Eidelstein <30617226+nodeav@users.noreply.github.com>
This commit is contained in:
@ -79,7 +79,7 @@ class SegLoss(Loss):
|
||||
# targets
|
||||
try:
|
||||
batch_idx = batch['batch_idx'].view(-1, 1)
|
||||
targets = torch.cat((batch_idx, batch['cls'].view(-1, 1), batch['bboxes']), 1)
|
||||
targets = torch.cat((batch_idx, batch['cls'].view(-1, 1), batch['bboxes'].to(dtype)), 1)
|
||||
targets = self.preprocess(targets.to(self.device), batch_size, scale_tensor=imgsz[[1, 0, 1, 0]])
|
||||
gt_labels, gt_bboxes = targets.split((1, 4), 2) # cls, xyxy
|
||||
mask_gt = gt_bboxes.sum(2, keepdim=True).gt_(0)
|
||||
|
Reference in New Issue
Block a user