Coder Social home page Coder Social logo

open-unmix-js's People

Contributors

ajmcallister27 avatar clarajacintho avatar deltonvaz avatar dependabot[bot] avatar faroit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ajmcallister27

open-unmix-js's Issues

add progress status

while waiting users should be able to know the current wait status (aka. current block out of maximum number of blocks)

speed up processing

The original open-unmix model is quite slow and currently only runs on CPU.

  • can you test if it runs with the new WASM backend?

add a demo track

Instead of providing an upload we should also provide a url option. This should especially be used to so that we can provide a demo track.

Add progress callback

a callback function should be supported so that the UI would be able to get the current progress in percent.

support for mono channels

currently the model is expected to be running stereo. However, I also uploaded a mono model for speech enhancement where nb_channels = 1.

This can be implemented in the following way:

  • if the model only required as a single channel audio spectrogram but the audio input signal has two channels, the input spectrogram can just be averaged across the channel dimension and after model(input) the output mask would need to be duplicated again.
  • if the model only works with single channel and the audio input is also single channel, the preprocessing code would need to adjusted. This can be useful when we use the user input (from microphone) to record a mono signal and process it

Warmup: Audio to spectrogram <-> spectrogram to audio

In this task you get familiar with the most relevant signal processing that we need to perform separation with open-unmix or spleeter.
Pre-processing should be entirely in javascript but tested against python code:

Working pre-processing prototype

  • loads audio from a url into array
  • playback the audio using an tag or by creating an audiobuffer
  • Perform the STFT/ISTFT on audio signal
  • write unit test to evaluate the reconstruction error (should be in the ballpark of <10^-3)
  • extended unit tests to make the STFT/ISTFT compatible with numpy/scipy or tensorflow

Further References

Split umx.js into npm package and demo

When #8 is addressed the next step is to split the processing code.
Currently we have lot of duplicated code in demo/src/lib/umx.js and src/open-unmix.js.

We also have two npm packages: umx_js_demo (demo app) and open-unmix-js (the one that should live on npm)

Idea:

  • Core functionality/processing in src/open-unmix.js. This should basically export two functions. One that loads a model given a url (not there yet, since its hardcoded) and another one that actually process buffers (modelProcess).
  • I/O as well as web audio stuff should not be part of src/open-unmix.js.

That means src/open-unmix.js should work in node as well as browser. We can maybe re-add specific node function to load audio from cli, but I don't think this is high priority right now.

@deltonvaz @ClaraJacintho Do you like this?

One thing I don't know how to do: how can we add the open-unmix-js dev dependencies from umx_js_demo until the package is not registered on npm?

Flexible model loading

Currently the model parameters set globally when loading the lib. This makes changing the parameters when loading a new model a little bit cumbersome.

Therefore we should allow to load a model and also pass its parameters. The following ones are necessary:

// Fourier Params
const FRAME_LENGTH = config.fourierParams.frameLength
const HOP_LENGTH = config.fourierParams.hopLength
const FFT_SIZE = config.fourierParams.fftSize

// MODEL input dimensions
const N_FREQUENCIES = config.modelInput.N_FREQUENCIES
const N_FRAMES = config.modelInput.N_FRAMES
const N_CHANNELS = config.modelInput.N_CHANNELS
const N_BATCHES = config.modelInput.N_BATCHES

refactor folder structure

lets make the root folder the main folder for the npm package. The code for the vue-demo should be put in a subfolder like demo. The final (servable) demo should make available only in the gh-pages branch

Check related project

spleeter_js implements a fully working example of a similar project that includes STFT and tensorflowjs model inference to do source separation.

The source code can be inspected in the web page.

First steps include:

  • Evaluate the website
  • Check which parts of the code can be re-used/copied
  • Check which parts of the code could be better done in a framework
  • Find existing frameworks for STFT/ISTFT and general signal processing

References

Further References

Open-Unmix

Spleeter (Convolutional Neural Network)

Model conversion: TF to TF.js

write a python script that lives in a subfolder called "models"

  • download the 2-stem model that can be downloaded here
  • convert this to a tfjs model
  • apply compression if suitable

do not forget to add (conda) environment files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.