ultralytics 8.1.44 add IS_RASPBERRYPI and constants refactor (#9827)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-04-07 00:47:12 +02:00 committed by GitHub
parent 3f34a7c3af
commit 7d891a4aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 146 additions and 141 deletions

View file

@ -106,7 +106,7 @@ class DetectionValidator(BaseValidator):
if len(cls):
bbox = ops.xywh2xyxy(bbox) * torch.tensor(imgsz, device=self.device)[[1, 0, 1, 0]] # target boxes
ops.scale_boxes(imgsz, bbox, ori_shape, ratio_pad=ratio_pad) # native-space labels
return dict(cls=cls, bbox=bbox, ori_shape=ori_shape, imgsz=imgsz, ratio_pad=ratio_pad)
return {"cls": cls, "bbox": bbox, "ori_shape": ori_shape, "imgsz": imgsz, "ratio_pad": ratio_pad}
def _prepare_pred(self, pred, pbatch):
"""Prepares a batch of images and annotations for validation."""