def scaling_np(X, scaling=False): if scaling: X = X + 0.5 X_uint8 = np.clip(np.rint(X*255), 0, 255) X_bgr = preprocess_input(X_uint8) return X_bgr