(cfg, dataset_name)
| 329 | |
| 330 | |
| 331 | def get_config_from_name(cfg, dataset_name): |
| 332 | # adjust config according to dataset |
| 333 | # joint mapper for multiple part data |
| 334 | joint_part = cfg['DATASETS'].get('JOINT_PART_LOADER', False) |
| 335 | if 'sam' in dataset_name: |
| 336 | cfg.update(cfg['SAM']) |
| 337 | return cfg |
| 338 | if joint_part and ('pascal' in dataset_name or 'paco' in dataset_name or 'partimagenet' in dataset_name): |
| 339 | cfg.update(cfg['PART_ALL']) |
| 340 | return cfg |
| 341 | elif 'pascal' in dataset_name: |
| 342 | cfg.update(cfg['PSACAL_PART']) |
| 343 | return cfg |
| 344 | elif 'refcoco' in dataset_name: |
| 345 | cfg.update(cfg['REF']) |
| 346 | return cfg |
| 347 | elif 'coco' in dataset_name: |
| 348 | if 'COCO' in cfg.keys(): |
| 349 | cfg.update(cfg['COCO']) |
| 350 | return cfg |
| 351 | elif 'ade' in dataset_name: |
| 352 | if 'ADE20K' in cfg.keys(): |
| 353 | cfg.update(cfg['ADE20K']) |
| 354 | return cfg |
| 355 | elif 'imagenet' in dataset_name: |
| 356 | if 'IMAGENET' in cfg.keys(): |
| 357 | cfg.update(cfg['IMAGENET']) |
| 358 | return cfg |
| 359 | elif 'vlp' in dataset_name: |
| 360 | cfg.update(cfg['VLP']) |
| 361 | return cfg |
| 362 | elif 'sun' in dataset_name: |
| 363 | cfg.update(cfg['SUN']) |
| 364 | return cfg |
| 365 | elif 'object365' in dataset_name: |
| 366 | cfg.update(cfg['OBJECT365']) |
| 367 | return cfg |
| 368 | elif 'scan' in dataset_name: |
| 369 | cfg.update(cfg['SCAN']) |
| 370 | return cfg |
| 371 | elif 'cityscape' in dataset_name: |
| 372 | cfg.update(cfg['CITY']) |
| 373 | return cfg |
| 374 | elif 'bdd' in dataset_name: |
| 375 | cfg.update(cfg['BDD']) |
| 376 | return cfg |
| 377 | else: |
| 378 | assert False, "dataset not support." |
| 379 | |
| 380 | |
| 381 | def build_eval_dataloader(cfg, ): |
no test coverage detected