INNER CODE UNIT · Python
main
dailenson/SDT · test.py:12
def main(opt):
""" load config file into cfg"""
cfg_from_file(opt.cfg_file)
assert_and_infer_cfg()
"""setup data_loader instances"""
test_dataset = ScriptDataset(
cfg.DATA_LOADER.PATH, cfg.DATA_LOADER.DATASET, cfg.TEST.ISTRAIN, cfg.MODEL.NUM_IMGS)
test_loader = torch.utils.data.DataLoader(test_dataset,
batch_size=cfg.TRAIN.IMS_PER_BATCH,
shuffle=True,
sampler=None,
drop_last=False,
collate_fn=test_dataset.collate_fn_,
num_workers=cfg.DATA_LOADER.NUM_THREADS)
char_dict = test_dataset.char_dict
writer_dict = test_dataset.writer_dict