Skip to main content

PyO3 bindings for the official DeepFilterNet Rust realtime runtime

Project description

DeepFilterNet-rs

Python bindings for the official DeepFilterNet Rust realtime runtime.

This package exposes a small PyO3 wrapper around DeepFilterNet's Rust DfTract streaming runtime. It is intended for realtime audio enhancement pipelines that need a Python API without shelling out to the deep-filter binary.

Install

pip install deepfilternet-rs

When installing from source, a Rust toolchain is required because the package is built with maturin. Prebuilt wheels do not require Rust on the target machine.

Usage

import numpy as np
from deepfilternet_rs import DeepFilterNetRealtime

processor = DeepFilterNetRealtime(
    model_path=None,
    atten_lim=100.0,
    log_level="warn",
    compensate_delay=True,
    post_filter_beta=0.0,
)

audio = np.zeros(processor.frame_length, dtype=np.float32)
enhanced = processor.process_chunk(audio)
tail = processor.finalize()

API

DeepFilterNetRealtime

Constructor arguments:

Argument Type Default Description
model_path `str None` None
atten_lim float 100.0 Attenuation limit in dB. 100.0 means no explicit limit.
log_level `str None` None
compensate_delay bool True Drop initial algorithmic-delay samples from output.
post_filter_beta float 0.0 Post-filter beta. 0.0 disables the post-filter.

Properties:

Property Description
sample_rate Backend processing sample rate. Official DeepFilterNet models use 48000 Hz.
frame_length Frame length in samples. Official DeepFilterNet models use 480 samples.

Methods:

Method Description
process_chunk(audio) Process a one-dimensional float32 numpy array and return enhanced float32 samples. The input can be any length; incomplete frames are buffered.
finalize() Flush buffered samples with zero padding and close the processor.
close() Clear buffers and close the processor without flushing.

Release

Publishing is handled by GitHub Actions with PyPI Trusted Publishing. Create a GitHub release or run the release workflow manually after configuring the PyPI project trust relationship for this repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepfilternet_rs-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

deepfilternet_rs-0.1.0-cp312-cp312-win_amd64.whl (13.4 MB view details)

Uploaded CPython 3.12Windows x86-64

deepfilternet_rs-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

deepfilternet_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (13.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

deepfilternet_rs-0.1.0-cp311-cp311-win_amd64.whl (13.4 MB view details)

Uploaded CPython 3.11Windows x86-64

deepfilternet_rs-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

deepfilternet_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (13.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

deepfilternet_rs-0.1.0-cp310-cp310-win_amd64.whl (13.4 MB view details)

Uploaded CPython 3.10Windows x86-64

deepfilternet_rs-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

deepfilternet_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (13.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file deepfilternet_rs-0.1.0.tar.gz.

File metadata

  • Download URL: deepfilternet_rs-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deepfilternet_rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d54f4b038b616f545a8ee06eb99e27ccc0fe498f971e43ce4150febd26e425e1
MD5 9df3a2fef3ff351bf80f8abc8ff11c15
BLAKE2b-256 46f47b512c6c692666f32489e9501ed9b90e8073e538a5dc7bff2474116048d5

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0158070a5eedc8f1d801d41ec5c16d17fe93dd98d43647c5af898f7d478f0cc6
MD5 9ce01ec08298be22232d38d472042e29
BLAKE2b-256 82e9208fd9a476c562204e7d2842aff3ea3f8329b10ab240022a07bc52eb4b42

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41dd2ff60f0f283a9e63e239623403f9040c647fca705598f4c2ffb83b2a7b1f
MD5 6678e6650dadc70c374a7d9d19a8b303
BLAKE2b-256 82e8c71525f7d690988bf0a6a98e7fdcb19e96fe5a134dabadc714bbfe68d654

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7df4becba618264e0f5fe085a26abd2e5a1a79e7965db56d141e96b185678729
MD5 6bacacc3060ccbda88d8c84027af310f
BLAKE2b-256 4517aeb5aee59d043b54a580821e1683ba80452fbe648f15f4c2b16580961d15

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 79af56c46d42371ad225aa2c5d22a4910f9f142e01e9cd8c7b07d812edc67f36
MD5 13be197bc81c4bece887907485c6279d
BLAKE2b-256 aa21334ca728c4edfd920472cd83d45948e6e1fd1bbf378b7495a434609b3872

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 771d1c5fa581a745e1059b1c5634773da25d8a30fd53ad9607d48a2c7c67d5c5
MD5 0b1b11968021aef827017f3b31c00dca
BLAKE2b-256 5874371539d68401ba049e415f99161e96ec3d873f6694c3580fb33b66747408

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afe3606680f3707daaa035e6e302254af88c210e2b9699b3e94bdcb517273694
MD5 5231d3a2654ec56478af60e36a43cda7
BLAKE2b-256 de5eaa5ac58ce7ff834d3cf1ec12f943c6b16859e00187447143e9244833253b

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 91a89b7001ed3d544e5668e4e4554aa5a2259ee359207dfa045dcfd4c0c6a396
MD5 2079b77d11ba3db6580155e31b7a7c4a
BLAKE2b-256 242a99463b48fbd7f73a60223ca795c37bdd49ca70bb1727ba79c9678fd083f2

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76f933152f9844c26fb3c1f7cc9ec280ac36c077d372ba0a7052f72446dd4fba
MD5 974eb3042b809062a3a64077692f6ec0
BLAKE2b-256 973715334d79714e2b3b0bdc4c2e1ce801fbe92ec513a6d0dcf1d247ba98677e

See more details on using hashes here.

File details

Details for the file deepfilternet_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for deepfilternet_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6151c2a16b4382732593c5ffb98aafb02ce4d30e29ae1d04edfb6fe41ec4aa37
MD5 64c18e271338c774b5c4f31f726d56a2
BLAKE2b-256 2d133cff7d33114362e19c51350264336254a8870dbea6c53559a60c06f4d06e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page