From e913eeafcb2be669dccb7e0f52414bf2ab3b4811 Mon Sep 17 00:00:00 2001 From: IMLHF Date: Wed, 29 Dec 2021 18:19:46 +0800 Subject: [PATCH] Update sparse_image_warp_pytorch.py Fix function usage error --- SpecAugment/sparse_image_warp_pytorch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpecAugment/sparse_image_warp_pytorch.py b/SpecAugment/sparse_image_warp_pytorch.py index cb3e86a..bdbb18b 100644 --- a/SpecAugment/sparse_image_warp_pytorch.py +++ b/SpecAugment/sparse_image_warp_pytorch.py @@ -42,7 +42,7 @@ def time_warp(spec, W=5): # Uniform distribution from (0,W) with chance to be up to W negative dist_to_warp = random.randrange(-W, W) src_pts, dest_pts = torch.tensor([[[y, point_to_warp]]]), torch.tensor([[[y, point_to_warp + dist_to_warp]]]) - warped_spectro, dense_flows = SparseImageWarp.sparse_image_warp(spec, src_pts, dest_pts) + warped_spectro, dense_flows = sparse_image_warp(spec, src_pts, dest_pts) return warped_spectro.squeeze(3) @@ -407,4 +407,4 @@ def gather(y_coords, x_coords, name): interp_bottom = alphas[1] * (bottom_right - bottom_left) + bottom_left interp = alphas[0] * (interp_bottom - interp_top) + interp_top - return interp \ No newline at end of file + return interp