MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / get_config_from_name

Function get_config_from_name

datasets/build.py:331–378  ·  view source on GitHub ↗
(cfg, dataset_name)

Source from the content-addressed store, hash-verified

329
330
331def 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
381def build_eval_dataloader(cfg, ):

Callers 2

build_eval_dataloaderFunction · 0.85
build_train_dataloaderFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected