Skip to content

Instantly share code, notes, and snippets.

@trongan93
Created June 12, 2020 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trongan93/46716c85d1243b081e9fcb17dac94981 to your computer and use it in GitHub Desktop.
Save trongan93/46716c85d1243b081e9fcb17dac94981 to your computer and use it in GitHub Desktop.
ship_detection_preparedata
# output encoding
y = tensorflow.keras.utils.to_categorical(output_data, 2)
# shuffle all indexes
indexes = np.arange(2800)
np.random.shuffle(indexes)
X_train = X[indexes].transpose([0,2,3,1])
y_train = y[indexes]
# normalization
X_train = X_train / 255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment