Skip to content

Commit

Permalink
Simpler random code
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Nov 25, 2023
1 parent d4e7579 commit 0f5f89e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/trainers/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def forward(self, images: Any, targets: Any = None) -> Any:
else: # eval mode
output = []
for i in range(batch_size):
boxes = torch.zeros(10, 4, dtype=torch.float)
# Create xmax, ymax larger than 0.0
boxes[:, 2:4] = torch.FloatTensor(10, 2).uniform_(0.1, 0.9)
boxes = torch.rand(10, 4)
# xmax, ymax must be larger than xmin, ymin
boxes[:, 2:] += 1
output.append(
{
"boxes": boxes,
Expand Down

0 comments on commit 0f5f89e

Please sign in to comment.