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

Function get_data

examples/ImageNetModels/alexnet.py:66–85  ·  view source on GitHub ↗
(name, batch)

Source from the content-addressed store, hash-verified

64
65
66def get_data(name, batch):
67 isTrain = name == 'train'
68 if isTrain:
69 augmentors = [
70 imgaug.ResizeShortestEdge(256, cv2.INTER_CUBIC),
71 imgaug.RandomCrop(224),
72 imgaug.Lighting(0.1,
73 eigval=np.asarray(
74 [0.2175, 0.0188, 0.0045][::-1]) * 255.0,
75 eigvec=np.array(
76 [[-0.5675, 0.7192, 0.4009],
77 [-0.5808, -0.0045, -0.8140],
78 [-0.5836, -0.6948, 0.4203]],
79 dtype='float32')[::-1, ::-1]),
80 imgaug.Flip(horiz=True)]
81 else:
82 augmentors = [
83 imgaug.ResizeShortestEdge(256, cv2.INTER_CUBIC),
84 imgaug.CenterCrop((224, 224))]
85 return get_imagenet_dataflow(args.data, name, batch, augmentors)
86
87
88def get_config():

Callers 1

get_configFunction · 0.70

Calls 1

get_imagenet_dataflowFunction · 0.90

Tested by

no test coverage detected