semvec/pypi-packages huggingface dataset:
pytest-tiny-api-client 1.0.1
The companion pytest plugin for tiny-api-client
Requires Python: >=3.10

# pytest-tiny-api-client

[![License: GPL  v2][license-shield]][gnu]

An official companion pytest plugin for the [`tiny-api-client`][tiny-api-client] library.

```python
from my_api import MyClient

def test_my_client(api_call):
    api_call.return_value = {"name": "Peter"}
    user = MyClient().find_user(user_id=...)
    assert user.name == "Peter"
```

One of the problems with testing functions that have been decorated is that
decoration happens at import time, which means the decorators cannot
be patched within each test without having to re-import the modules.

This plugin will patch these decorators at import time, and allow you to patch
the implementation during testing. To make this easier, this plugin exposes the
`api_call` fixture, which is a `unittest.mock.Mock` object which can be used to
test your endpoint methods with fake data.

For more details on how to use this fixture, check the documentation.



## Installation

```bash
pip install pytest-tiny-api-client
```



## Documentation

You can find the documentation at https://tiny-api-client.readthedocs.io



## License

[![License: LGPL  v2.1][license-shield]][gnu]

This software is distributed under the [Lesser General Public License v2.1][license], more information available at the [Free Software Foundation][gnu].


<!-- LINKS -->

[tiny-api-client]: https://github.com/sanjacob/tiny-api-client


<!-- LICENSE -->

[license]: LICENSE "Lesser General Public License v2.1"
[gnu]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html "Free Software Foundation"
[license-shield]: https://img.shields.io/github/license/sanjacob/pytest-tiny-api-client


<!-- SHIELD LINKS -->

[pypi]: https://pypi.org/project/pytest-tiny-api-client


<!-- SHIELDS -->

[pypi-shield]: https://img.shields.io/pypi/v/pytest-tiny-api-client
[build-shield]: https://img.shields.io/github/actions/workflow/status/sanjacob/pytest-tiny-api-client/build.yml?branch=master
[docs-shield]: https://img.shields.io/readthedocs/tiny-api-client
resemble-enhance 0.0.2.dev240104122303
Speech denoising and enhancement with deep learning
Requires Python: >=3.10

# Resemble Enhance

[![PyPI](https://img.shields.io/pypi/v/resemble-enhance.svg)](https://pypi.org/project/resemble-enhance/)
[![Hugging Face Space](https://img.shields.io/badge/Hugging%20Face%20%F0%9F%A4%97-Space-yellow)](https://huggingface.co/spaces/ResembleAI/resemble-enhance)
[![License](https://img.shields.io/github/license/resemble-ai/Resemble-Enhance.svg)](https://github.com/resemble-ai/resemble-enhance/blob/main/LICENSE)
[![Webpage](https://img.shields.io/badge/Webpage-Online-brightgreen)](https://www.resemble.ai/enhance/)

https://github.com/resemble-ai/resemble-enhance/assets/660224/bc3ec943-e795-4646-b119-cce327c810f1

Resemble Enhance is an AI-powered tool that aims to improve the overall quality of speech by performing denoising and enhancement. It consists of two modules: a denoiser, which separates speech from a noisy audio, and an enhancer, which further boosts the perceptual audio quality by restoring audio distortions and extending the audio bandwidth. The two models are trained on high-quality 44.1kHz speech data that guarantees the enhancement of your speech with high quality.

## Usage

### Installation

Install the stable version:

```bash
pip install resemble-enhance --upgrade
```

Or try the latest pre-release version:

```bash
pip install resemble-enhance --upgrade --pre
```

### Enhance

```
resemble_enhance in_dir out_dir
```

### Denoise only

```
resemble_enhance in_dir out_dir --denoise_only
```

### Web Demo

We provide a web demo built with Gradio, you can try it out [here](https://huggingface.co/spaces/ResembleAI/resemble-enhance), or also run it locally:

```
python app.py
```

## Train your own model

### Data Preparation

You need to prepare a foreground speech dataset and a background non-speech dataset. In addition, you need to prepare a RIR dataset ([examples](https://github.com/RoyJames/room-impulse-responses)).

```bash
data
├── fg
│   ├── 00001.wav
│   └── ...
├── bg
│   ├── 00001.wav
│   └── ...
└── rir
    ├── 00001.npy
    └── ...
```

### Training

#### Denoiser Warmup

Though the denoiser is trained jointly with the enhancer, it is recommended for a warmup training first.

```bash
python -m resemble_enhance.denoiser.train --yaml config/denoiser.yaml runs/denoiser
```

#### Enhancer

Then, you can train the enhancer in two stages. The first stage is to train the autoencoder and vocoder. And the second stage is to train the latent conditional flow matching (CFM) model.

##### Stage 1

```bash
python -m resemble_enhance.enhancer.train --yaml config/enhancer_stage1.yaml runs/enhancer_stage1
```

##### Stage 2

```bash
python -m resemble_enhance.enhancer.train --yaml config/enhancer_stage2.yaml runs/enhancer_stage2
```

## Blog

Learn more on our [website](https://www.resemble.ai/enhance/)!