Giter Site home page Giter Site logo

hmartelb / avlit Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 1.0 436 KB

Official source code of the INTERSPEECH 2023 paper: "Audio-Visual Speech Separation in Noisy Environments with a Lightweight Iterative Model" (AVLIT)

Home Page: https://arxiv.org/abs/2306.00160

License: MIT License

Python 100.00%
audio-visual iterative multi-modal pytorch pytorch-lightning speech-enhancement speech-separation lightweight

avlit's Introduction


AVLIT: Audio-Visual Lightweight ITerative model

PyTorch arXiv Samples

Description

Official Pytorch Lightning implementation of "Audio-Visual Speech Separation in Noisy Environments with a Lightweight Iterative Model", accepted at INTERSPEECH 2023.

AVLIT_Folded AVLIT_Unfolded
(A) Folded view of AVLIT (B) Unfolded view of AVLIT

Audio-Visual Lightweight ITerative model (AVLIT) uses the A-FRCNN as building block. AVLIT employs a homogeneous design with audio and video branches composed of A-FRCNN blocks used iteratively. The weights are shared for each modality, making the number of parameters constant. Please refer to the paper for details.

Quick start

Installation

Make sure to have pytorch with GPU support installed on your machine according to the official installation guide.

Basic usage

Here is a minimal example of how to use AVLIT in plain Pytorch. The default parameters will produce the configuration for AVLIT-8, which is the best performing model in the paper.

from src.avlit import AVLIT

# Instantiate the model
model = AVLIT(
    num_sources = 2,
    # Audio branch
    audio_num_blocks = 8,
    # Video branch
    video_num_blocks = 4,
    video_encoder_checkpoint = "path/to/ae.ckpt",
)
model.cuda()

# Training or inference logic here
# ...

Advanced usage

For more control over the architecture, it is possible to provide values for more parameters as follows:

from src.avlit import AVLIT

# Instantiate the model
model = AVLIT(
    num_sources = 2,
    # Audio branch
    kernel_size = 40,
    audio_hidden_channels = 512,
    audio_bottleneck_channels = 128,
    audio_num_blocks = 8,
    audio_states = 5,
    # Video branch
    video_hidden_channels = 128,
    video_bottleneck_channels = 128,
    video_num_blocks = 4,
    video_states = 5,
    video_encoder_checkpoint = "path/to/ae.ckpt",
    video_encoder_trainable = False,
    video_embedding_dim = 1024,
    # AV fusion
    fusion_operation = "sum",
    fusion_positions = [4],
)
model.cuda()

# Training or inference logic here
# ...

Tests

The tests/ folder contains unit tests for the AVLIT architecture. It is useful to run these tests if you want to customize the configuration parameters to verify that the input/output shapes are as expected and that the model can perform a forward pass correctly on CPU/GPU.

To run all the unit tests, make sure to install the pytest package and run:

pytest tests/test_models.py 

Cite

If you use AVLIT in your research, please cite our paper:

@inproceedings{martel23_interspeech,
  author={Héctor Martel and Julius Richter and Kai Li and Xiaolin Hu and Timo Gerkmann},
  title={{Audio-Visual Speech Separation in Noisy Environments with a Lightweight Iterative Model}},
  year=2023,
  booktitle={Proc. INTERSPEECH 2023},
  pages={1673--1677},
  doi={10.21437/Interspeech.2023-1753}
}

Contact

  • For technical/academic questions please write an email to the corresponding authors mentioned in the paper. Alternatively, use the discussions page. Do not open an issue.
  • For bugs or problems with the code, please open an issue in this repository.
  • For other inquiries, contact me via email at [email protected].

Changelog

  • [2023/07/26] 🎧 Demo samples website made public.
  • [2023/06/02] 🚀 Model code released.
  • [2023/05/31] 📰 Final version made public on arXiv.org.
  • [2023/05/17] 📰 Paper accepted at INTERSPEECH 2023!

License

This code is licensed under the terms of the MIT License.

MIT License
Copyright (c) 2023 Héctor Martel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

avlit's People

Contributors

hmartelb avatar jusperlee avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

jusperlee

avlit's Issues

What is it ae.ckpt?

In model configuration i am see:
video_encoder_checkpoint = "path/to/ae.ckpt",
What is it? Where i am can get this ae.ckpt file?

separate audio mixture only

Thank you for the awesome work.
Is it possible to separate the input audio mixture only without video frames? (maybe by setting the video path to null).

Thank you

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.