Created
October 26, 2022 07:57
-
-
Save FrancescoSaverioZuppichini/100e480efcd1085fe9587a4759d6a673 to your computer and use it in GitHub Desktop.
Test
This file contains 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
max_bboxes = 3 | |
scaling = torch.tensor([1, .96, .97, 1.02]) | |
shifting = torch.tensor([0, 0.001, 0.002, -0.002]) | |
# broadcasting magic (2, 1, 4) * (1, 3, 1) | |
bboxes = (original_bboxes[:,None,:] * scaling[..., None] + shifting[..., None]).view(-1, 4) | |
plot_bboxes(img, bboxes, colors=[*["yellow"] * 4, *["blue"] * 4], labels=[*["head"] * 4, *["mic"] * 4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment