Input parameters for tfa.image.sparse_image_warp

I have the log mel spectrograms of a few audio clips and I am trying to augment the spectrograms using tfa.image.sparse_image_warp so that time warping can be achieved as done in Google’s SpecAugment

But I am confused on how to do achieve time warping as the documentation does not specify how to initialize arguments to sparse_image_warp.

The method declaration is like this:

image: tfa.types.TensorLike,
source_control_point_locations: tfa.types.TensorLike,
dest_control_point_locations: tfa.types.TensorLike,
interpolation_order: int = 2,
regularization_weight: tfa.types.FloatTensorLike = 0.0,
num_boundary_points: int = 0,
name: str = ‘sparse_image_warp’) → tf.Tensor

Can someone point out how to initialize source_control_point_locations, dest_control_point_locations and num_boundary_points?

1 Like

I suppose you need to use the Deepspeech fork of this

See this thread: