(filename_list, batch_size)
| 130 | |
| 131 | |
| 132 | def 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 |
nothing calls this directly
no outgoing calls
no test coverage detected