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

Support for mobile development (Android)? #690

Closed
lxaw opened this issue Feb 20, 2024 · 3 comments
Closed

Support for mobile development (Android)? #690

lxaw opened this issue Feb 20, 2024 · 3 comments
Labels
question Further information is requested

Comments

@lxaw
Copy link

lxaw commented Feb 20, 2024

First, I'd like to thank everyone for their work here. This is great stuff.

Has anyone tried to download one of the pytorch models and run on Android? I am trying to make a speech separation application, using this model: https://zenodo.org/records/3873670

Following this, I was able to load the model into Android studio, but am having trouble understanding how to call separate on it.

In Python on my PC, I was able to successfully run the following:

from asteroid.models import BaseModel
import soundfile as sf

# 'from_pretrained' automatically uses the right model class (asteroid.models.DPRNNTasNet).
model = BaseModel.from_pretrained("mpariente/DPRNNTasNet-ks2_WHAM_sepclean")

# You can pass a NumPy array:
mixture, _ = sf.read("female-female-mixture.wav", dtype="float32", always_2d=True)
# Soundfile returns the mixture as shape (time, channels), and Asteroid expects (batch, channels, time)
mixture = mixture.transpose()
mixture = mixture.reshape(1, mixture.shape[0], mixture.shape[1])
out_wavs = model.separate(mixture)

# Or simply a file name:
model.separate("female-female-mixture.wav")

However, I cannot call 'separate' in Android.

Anyone ever tried to take a model and run on Android?

@lxaw lxaw added the question Further information is requested label Feb 20, 2024
@mpariente
Copy link
Collaborator

Good question, but sorry, I did not !

@lxaw
Copy link
Author

lxaw commented Mar 14, 2024

No worries! I'll see if I can get it working. Thanks!

@lxaw lxaw closed this as completed Mar 14, 2024
@mehao-aaa
Copy link

Hi, how did you run on Android, how the effect is?
@lxaw

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

No branches or pull requests

3 participants