Skip to content

Deep Learning Tools#1384

Closed
hugofloresgarcia wants to merge 17 commits intoaudacity:masterfrom
TEAMuP-dev:deeplearning
Closed

Deep Learning Tools#1384
hugofloresgarcia wants to merge 17 commits intoaudacity:masterfrom
TEAMuP-dev:deeplearning

Conversation

@hugofloresgarcia
Copy link
Copy Markdown
Collaborator

Adds source separation and deep learning tools to audacity.

  • I signed CLA
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"

@hugofloresgarcia hugofloresgarcia force-pushed the deeplearning branch 3 times, most recently from 2717ab8 to eeefb21 Compare August 2, 2021 21:41
Copy link
Copy Markdown
Contributor

@crsib crsib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just quickly run through :)

As an addition to other comments - there are some files without an empty line at the end of the file.

@hugofloresgarcia hugofloresgarcia force-pushed the deeplearning branch 13 times, most recently from b5256dd to 617ff86 Compare August 10, 2021 18:29
Copy link
Copy Markdown
Contributor

@crsib crsib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, quite a few files still miss new line in the end of file

@crsib
Copy link
Copy Markdown
Contributor

crsib commented Aug 11, 2021

Also, it looks like we should only allow Source Separation in Win64 builds

@hugofloresgarcia hugofloresgarcia force-pushed the deeplearning branch 6 times, most recently from 5bdb211 to ff6016c Compare August 17, 2021 00:33
@hugofloresgarcia hugofloresgarcia marked this pull request as ready for review August 17, 2021 15:30
@hugofloresgarcia hugofloresgarcia force-pushed the deeplearning branch 3 times, most recently from db2d696 to f1371cc Compare August 17, 2021 21:25
Copy link
Copy Markdown
Contributor

@crsib crsib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should be improved:

  • Consistent use of const and final
  • I would preffer having *Ptr instead of *Holder
  • Translatable strings should have hints for translators
  • Error handling should be more consistent. Important context information should not be lost
  • != instead of !(=) whenver possible
  • In most cases - it is advised to have separate h/cpp for a class. Exceptions are ok to be groupped whith the class that throws it

@Paul-Licameli
Copy link
Copy Markdown
Collaborator

Paul-Licameli commented Jan 13, 2022

@hugofloresgarcia I have not yet caught up in a second round of review of your anwsers to my suggestions -- let me know when the branch is stable and I should do it.

Meanwhile I have pushed two more suggested commits.

The first is a cherry-pick from the master, which will disappear from this branch if you rebase it onto latest master.

The second makes use of the new utility defined in the first, to simplify the sending of messages from ActiveModel, which is the class I introduced to break dependency cycles.

This is the well known "Observer Pattern" in action -- it is a great friend for the breaking of cycles, and I use it so often I wrote a new class template to help generate instances of it.

It often happens that something UI related, like the dialog here, needs to be at the higher level of the dependency graph, and so it is the "subscriber" to messages that are "published" by the lower level object (here ActiveModel) which ought to implement the core logic of the program and not have unnecessary dependencies on the UI code.

In well structured code, the flow of control often goes in the opposite direction to the static build-time dependency arrows, and indirect function calls through pointers make this possible.

@hugofloresgarcia hugofloresgarcia force-pushed the deeplearning branch 4 times, most recently from fa2f0af to 2285a28 Compare January 14, 2022 17:00
By explicitly specifying the StartupWMClass, the elementaryOS Dock is now able
to associate Audacity's window with the flatpak-launcher icon so that it does
not spawn a second icon for Audacity.
@hugofloresgarcia hugofloresgarcia force-pushed the deeplearning branch 2 times, most recently from 4858f99 to ce3989d Compare January 18, 2022 01:56
    - Adds libtorch (a deep learning library) via conan.
    - Adds instructions for building Audacity with Deep Learning features.
    -  Adds deeplearning-models, a module with built-in deep learning models.
    - Adds mod-deep-learning, which contains source code files for Audacity's Deep Learning module.
    - Adds a DeepModel class, a container for using libtorch neural network models to process audio waveforms.
    - Adds a ModelCard class, a DTO for parsing deep model metadata stored in JSON format,
     with appropriate serialization/deserialization utilities
    a singleton object for downloading and managing deep learning models, hosted in HuggingFace and installed locally.
    to store the user's choice of model, and send notifications of its changes
    an abstract class for building UI panels out of ModelCards, and two derived classes for displaying ModelCards two different ways (compact and detailed).
Deep Learning Effect and Deep Learning Analyzer.

Deep Learning Effect performs waveform to waveform processing,
and is useful for audio-in-audio-out tasks (such as source separation,
voice conversion, style transfer, amplifier emulation, etc.),
while Deep Learning Analyzer performs waveform to labels processing,
and is useful for annotation tasks (such as sound event detection,
musical instrument recognition, automatic speech recognition, etc.).
    This simplifies the interaction between the ModelManager and UI objects, since they can just wait for ModelCards to finish  fetching.
    Adds threading capabilities to the model manager via ThreadPool
    Adds a find function to ModelCardCollection
    Removes ModelSizeCallbacks from ModelManagerPanel, since all of this is Handled by the ModelManager now.
    Removes card fetch status bar
crsib and others added 2 commits January 26, 2022 11:02
CopyLibs was invoked for modules only on macOS.

However, if the module depends on different set of libraries - Audacity will fail to load it.
BUILDING.md Outdated

### Building with Deep Learning

To enable deep learning features, pass `audacity_has_deep_learning=on` and `audacity_has_networking=yes` to CMake.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be audacity_has_deeplearning?

@LWinterberg LWinterberg removed a link to an issue Jan 24, 2023
@LWinterberg
Copy link
Copy Markdown
Member

Hello! We just switched master to 4.0.0 which makes this PR incompatible and/or obsolete as we're switching UI framework and reorganizing large parts of the codebase.

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

Successfully merging this pull request may close these issues.

8 participants