MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / make_transforms_for_crowdhuman

Function make_transforms_for_crowdhuman

tutorials/motr/joint.py:233–263  ·  view source on GitHub ↗
(image_set, args=None)

Source from the content-addressed store, hash-verified

231
232
233def make_transforms_for_crowdhuman(image_set, args=None):
234
235 normalize = T.MotCompose([
236 T.MotToTensor(),
237 T.MotNormalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
238 ])
239 scales = [608, 640, 672, 704, 736, 768, 800, 832, 864, 896, 928, 960, 992]
240
241 if image_set == 'train':
242 return T.MotCompose([
243 T.MotRandomHorizontalFlip(),
244 T.FixedMotRandomShift(bs=1),
245 T.MotRandomSelect(
246 T.MotRandomResize(scales, max_size=1536),
247 T.MotCompose([
248 T.MotRandomResize([400, 500, 600]),
249 T.FixedMotRandomCrop(384, 600),
250 T.MotRandomResize(scales, max_size=1536),
251 ])
252 ),
253 normalize,
254
255 ])
256
257 if image_set == 'val':
258 return T.MotCompose([
259 T.MotRandomResize([800], max_size=1333),
260 normalize,
261 ])
262
263 raise ValueError(f'unknown {image_set}')
264
265
266def build_dataset2transform(args, image_set):

Callers 1

build_dataset2transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected