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: Memory Efficiency for long recordings #226

Open
Evan8456 opened this issue Dec 20, 2024 · 9 comments
Open

Support: Memory Efficiency for long recordings #226

Evan8456 opened this issue Dec 20, 2024 · 9 comments
Labels
question Further information is requested

Comments

@Evan8456
Copy link

Evan8456 commented Dec 20, 2024

Issue Description

Had trouble performing feature extraction locally on audio recordings longer than a minute.

Environment Details

Ram: 16 Gb
Os: Ubuntu 20.04.3 LTS
Python: 3.10.9

Attempted Solutions

No response

Reproduction Steps

No response

Additional Notes

No response

@Evan8456 Evan8456 added the question Further information is requested label Dec 20, 2024
Copy link

👋 Welcome to Senselab!

Thank you for your interest and contribution. Senselab is a comprehensive Python package designed to process behavioral data, including voice and speech patterns, with a focus on reproducibility and robust methodologies. Your issue will be reviewed soon. Stay tuned!

@fabiocat93
Copy link
Collaborator

Hi @Evan8456, thank you for reporting the issue! Could you please provide more details on the problem you're experiencing? Are you encountering any specific error messages? Any unusual behavior during the process? Does it just stick forever?

Additionally, could you share the steps or code to help us reproduce the issue on our end? This will allow us to understand the problem better and assist you more effectively

@Evan8456
Copy link
Author

Hi, you can see the context of my issue here. The bug seems to occur when I attempt to run extract_features_from_audios on audio recordings that are 30+ seconds long.

@ibevers
Copy link
Collaborator

ibevers commented Mar 11, 2025

We've agreed it should be a lazy object.

@ibevers
Copy link
Collaborator

ibevers commented Mar 11, 2025

Laziness possibly optional

@ibevers
Copy link
Collaborator

ibevers commented Mar 11, 2025

Is there a version of torchaudio load that is lazy? Possibly, similar to: librosa, cv2

@fabiocat93
Copy link
Collaborator

Is there a version of torchaudio load that is lazy? Possibly, similar to: librosa, cv2

I have checked and unfortunately librosa doesn't seem to have lazy load 👎

@900miles
Copy link
Collaborator

I have checked and unfortunately librosa doesn't seem to have lazy load 👎

librosa.stream seems to be fairly similar -- it returns a generator of audio chunks rather than loading the whole audio into memory at once.

The library I was thinking of during the meeting was soundfile (which it looks like librosa uses underneath). The SoundFile class opens an audio file, then you can use various methods to seek around in that audio file and read/write a given amount of frames.

@fabiocat93
Copy link
Collaborator

I have checked and unfortunately librosa doesn't seem to have lazy load 👎

librosa.stream seems to be fairly similar -- it returns a generator of audio chunks rather than loading the whole audio into memory at once.

The library I was thinking of during the meeting was soundfile (which it looks like librosa uses underneath). The SoundFile class opens an audio file, then you can use various methods to seek around in that audio file and read/write a given amount of frames.

maybe StreamReader is the corresponding tool in torchaudio: https://pytorch.org/audio/main/tutorials/streamreader_basic_tutorial.html

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

When branches are created from issues, their pull requests are automatically linked.

4 participants