(image_set, args=None)
| 231 | |
| 232 | |
| 233 | def 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 | |
| 266 | def build_dataset2transform(args, image_set): |
no outgoing calls
no test coverage detected