MCPcopy Index your code
hub / github.com/FoundationVision/ByteTrack / random_resize

Function random_resize

yolox/data/data_prefetcher.py:59–77  ·  view source on GitHub ↗
(data_loader, exp, epoch, rank, is_distributed)

Source from the content-addressed store, hash-verified

57
58
59def random_resize(data_loader, exp, epoch, rank, is_distributed):
60 tensor = torch.LongTensor(1).cuda()
61 if is_distributed:
62 synchronize()
63
64 if rank == 0:
65 if epoch > exp.max_epoch - 10:
66 size = exp.input_size
67 else:
68 size = random.randint(*exp.random_size)
69 size = int(32 * size)
70 tensor.fill_(size)
71
72 if is_distributed:
73 synchronize()
74 dist.broadcast(tensor, 0)
75
76 input_size = data_loader.change_input_dim(multiple=tensor.item(), random_range=None)
77 return input_size

Callers

nothing calls this directly

Calls 2

synchronizeFunction · 0.90
change_input_dimMethod · 0.80

Tested by

no test coverage detected