Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ketos ketos
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • public_projects
  • ketosketos
  • Merge requests
  • !257

Merged
Created Aug 17, 2022 by Oliver Kirsebom@kirsebomOwner

Remove/reduce librosa dependencies

  • Overview 7
  • Commits 7
  • Pipelines 4
  • Changes 12

I was getting annoyed with slow (5 sec) import speeds for ketos audio modules, so I investigated the matter and found that librosa was taking over 5 seconds to import!

Screenshot_from_2022-08-17_08-55-42

I was able to remove some librosa dependencies, using soundfile instead for determining file duration and sampling rate (without loading the entire audio data content into memory).

However, some librosa dependencies remain. In particular,

  • resampling in Waveform module
  • cqt function in misc module
  • spec2wave function in misc module

still depend on librosa. For now, I have moved the imports to within these functions so that librosa only gets imported when/if these functions are callled.

As a next step, I would suggest we try to reimplement resampling with a different library, e.g., perhaps scipy?

This is the import speed profiling after the changes:

Screenshot_from_2022-08-17_09-39-59

Much nicer.

@bpadovese , please have a look at this when you have time. We can either merge this already, or continue working on the resampling stuff before merging.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: remove_librosa_dependencies