Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the methodology of getting source and dest points logical in Time Warp? #15

Closed
PrathamSoni opened this issue Jan 22, 2021 · 0 comments

Comments

@PrathamSoni
Copy link
Contributor

PrathamSoni commented Jan 22, 2021

`def time_warp(spec, W=5):
num_rows = spec.shape[1]
spec_len = spec.shape[2]
device = spec.device
y = num_rows//2
horizontal_line_at_ctr = spec[0][y]
assert len(horizontal_line_at_ctr) == spec_len

point_to_warp = horizontal_line_at_ctr[random.randrange(W, spec_len - W)]
assert isinstance(point_to_warp, torch.Tensor)

# 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]]], device=device), 
                     torch.tensor([[[y, point_to_warp + dist_to_warp]]], device=device))
warped_spectro, dense_flows = sparse_image_warp(spec, src_pts, dest_pts)
return warped_spectro.squeeze(3)`

Based on my understanding, the point given should be a time coordinate. Currently, the point to wrap is returning an actual value from the spectrogram, which does not align with the computation of source and dest points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant