MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get_data

Function get_data

examples/Saliency/CAM-resnet.py:59–72  ·  view source on GitHub ↗
(train_or_test)

Source from the content-addressed store, hash-verified

57
58
59def get_data(train_or_test):
60 # completely copied from imagenet-resnet.py example
61 isTrain = train_or_test == 'train'
62
63 datadir = args.data
64 ds = dataset.ILSVRC12(datadir, train_or_test, shuffle=isTrain)
65 augmentors = fbresnet_augmentor(isTrain)
66 augmentors.append(imgaug.ToUint8())
67
68 ds = AugmentImageComponent(ds, augmentors, copy=False)
69 if isTrain:
70 ds = MultiProcessRunnerZMQ(ds, min(25, multiprocessing.cpu_count()))
71 ds = BatchData(ds, BATCH_SIZE, remainder=not isTrain)
72 return ds
73
74
75def get_config():

Callers 2

get_configFunction · 0.70
viz_camFunction · 0.70

Calls 5

fbresnet_augmentorFunction · 0.90
BatchDataClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected