def _sample_to_features(x, frontend_args, tflite): if frontend_args is None: frontend_args = {} return tf_frontend.compute_frontend_features(x, 16000, tflite=tflite, **frontend_args)
def _sample_to_features(x): return tf_frontend.compute_frontend_features(x, 16000, overlap_seconds=79)
def test_multibatch_sanity(self): for shape in [[16000], [1, 16000], [3, 20000]]: tf_frontend.compute_frontend_features(tf.zeros(shape, tf.float32), sr=16000, frame_hop=5)
def _sample_to_features(x, export_tflite=False): return tf_frontend.compute_frontend_features(x, 16000, overlap_seconds=79, tflite=export_tflite)
def _feature_fn(x, s): return tf.expand_dims(tf_frontend.compute_frontend_features( x, s, overlap_seconds=79), axis=-1).numpy().astype(np.float32)
def default_feature_fn(samples, sample_rate): frontend_args = tf_frontend.frontend_args_from_flags() feats = tf_frontend.compute_frontend_features(samples, sample_rate, **frontend_args) logging.info('Feats shape: %s', feats.shape) return tf.expand_dims(feats, axis=-1).numpy().astype(np.float32)
def _default_feature_fn(samples, sample_rate): return tf.expand_dims(tf_frontend.compute_frontend_features( samples, sample_rate, overlap_seconds=79), axis=-1).numpy().astype(np.float32)
def _sample_to_features(x, export_tflite=False): frontend_args = tf_frontend.frontend_args_from_flags() return tf_frontend.compute_frontend_features(x, 16000, tflite=export_tflite, **frontend_args)
def _default_feature_fn(samples, sample_rate): frontend_args = tf_frontend.frontend_args_from_flags() feats = tf_frontend.compute_frontend_features(samples, sample_rate, **frontend_args) return tf.expand_dims(feats, axis=-1).numpy().astype(np.float32)
def _feature_fn(x, s): return tf.expand_dims(tf_frontend.compute_frontend_features( x, s, frame_hop=17), axis=-1).numpy().astype(np.float32)