Created
December 28, 2022 09:55
-
-
Save AlessandroMondin/e2208a9e24eae45e4faa3014659ba9a9 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.bboxes_format == "coco": | |
labels[:, -1] -= 1 # 0-indexing the classes of coco labels (1-80 --> 0-79) | |
labels = np.roll(labels, axis=1, shift=1) | |
# normalized coordinates are scale invariant, hence after resizing the img we don't resize labels | |
labels[:, 1:] = coco_to_yolo_tensors(labels[:, 1:], w0=img.shape[1], h0=img.shape[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment