train.py的221行是做train_loader。
train_loader = make_dataloader(
cfg, is_train=True, distributed=args.distributed
)
他这里有几句下面是被make_dataloader所包含的一个函数在dataset.buld.py里
def build_dataset(cfg, is_train):
assert is_train is True, 'Please only use build_dataset for training.'
transforms = build_transforms(cfg, is_train)
heatmap_generator = HeatmapGenerator(
cfg.DATASET.OUTPUT_SIZE, cfg.DATASET.NUM_JOINTS
)
offset_generator = OffsetGenerator(
cfg.DATASET.OUTPUT_SIZE, cfg.DATASET.OUTPUT_SIZE,
cfg.DATASET.NUM_JOINTS, cfg.DATASET.OFFSET_RADIUS
)
dataset = eval(cfg.DATASET.DATASET)(
cfg,
cfg.DATASET.TRAIN,
heatmap_generator,
offset_generator,
transforms
)
return dataset
先转换再读取数据
标签:generator,cfg,hrnet,dataset,train,transforms,DATASET From: https://www.cnblogs.com/hahaah/p/17050889.html