Created
December 28, 2022 11:12
-
-
Save AlessandroMondin/df82d965560ea1dd829b401a262cbea4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if self.ultralytics_loss: | |
labels = torch.from_numpy(labels) | |
out_bboxes = torch.zeros((labels.shape[0], 6)) | |
if len(labels): | |
out_bboxes[..., 1:] = labels | |
img = img.transpose((2, 0, 1)) | |
img = np.ascontiguousarray(img) | |
return torch.from_numpy(img), out_bboxes if self.ultralytics_loss else labels |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment