MCPcopy Create free account
hub / github.com/SystemErrorWang/White-box-Cartoonization / next_batch

Function next_batch

train_code/utils.py:132–143  ·  view source on GitHub ↗
(filename_list, batch_size)

Source from the content-addressed store, hash-verified

130
131
132def next_batch(filename_list, batch_size):
133 idx = np.arange(0 , len(filename_list))
134 np.random.shuffle(idx)
135 idx = idx[:batch_size]
136 batch_data = []
137 for i in range(batch_size):
138 image = cv2.imread(filename_list[idx[i]])
139 image = image.astype(np.float32)/127.5 - 1
140 #image = image.astype(np.float32)/255.0
141 batch_data.append(image)
142
143 return np.asarray(batch_data)
144
145
146

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected