Skip to main content

GTCRN audio enhancement model for fasr

Project description

fasr-enhancement-gtcrn

英文文档地址: README_EN.md

GTCRN 音频增强插件。第一版内置官方 gtcrn_simple.onnx,并通过 EnhancementModel.enhance() 提供离线整段音频增强能力。

安装

pip install fasr-enhancement-gtcrn

注册模型

注册名 适用场景
gtcrn GTCRNEnhancement 轻量级 CPU 降噪

使用方式

from fasr.data import Waveform
from fasr_enhancement_gtcrn import GTCRNEnhancement

model = GTCRNEnhancement(sample_rate=16000)
enhanced = model.enhance(Waveform(data=audio, sample_rate=16000))

Confection 配置

[enhancement_model]
@enhancement_models = "gtcrn"
sample_rate = 16000
providers = ["CPUExecutionProvider"]
intra_op_num_threads = 1
inter_op_num_threads = 1

参数

参数 类型 默认值 说明
sample_rate int 16000 输出采样率
model_path str | None None 可选自定义 ONNX 模型路径,默认使用内置模型
providers list[str] ["CPUExecutionProvider"] ONNX Runtime 推理 provider
intra_op_num_threads int >= 1 1 显式设置 ORT intra-op 线程数,服务端推荐开启以避免默认绑核告警
inter_op_num_threads int >= 1 1 显式设置 ORT inter-op 线程数,服务端推荐开启以避免默认绑核告警
n_fft int 512 STFT FFT 大小
hop_length int 256 STFT hop 长度
win_length int 512 STFT window 长度

Realtime 状态

当前版本同时支持离线 enhance() 和流式 push_chunk()。流式路径复用了官方 streaming ONNX 的逐帧推理逻辑,并优先保证与离线输出的数值一致性。当前实现 通过 istft 重建新产生的尾部音频,稳定且容易验证,但在 CPU 开销上还不是最 终极的高性能包装方式。

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

fasr_enhancement_gtcrn-0.5.8.tar.gz (135.6 kB view details)

Uploaded Source

Built Distribution

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

fasr_enhancement_gtcrn-0.5.8-py3-none-any.whl (135.7 kB view details)

Uploaded Python 3

File details

Details for the file fasr_enhancement_gtcrn-0.5.8.tar.gz.

File metadata

  • Download URL: fasr_enhancement_gtcrn-0.5.8.tar.gz
  • Upload date:
  • Size: 135.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr_enhancement_gtcrn-0.5.8.tar.gz
Algorithm Hash digest
SHA256 29a42481f6d5bda41a552f8c8c23192fb8542308e58797face190bcf6bd6d6a5
MD5 199d43e3aff76756f71113cbda5f7057
BLAKE2b-256 bb37d2954662811304b646be1929bb9b83916efb0cd4275acb4570d6baba469a

See more details on using hashes here.

File details

Details for the file fasr_enhancement_gtcrn-0.5.8-py3-none-any.whl.

File metadata

  • Download URL: fasr_enhancement_gtcrn-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 135.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr_enhancement_gtcrn-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3ae010da069c062b86394742643b3b9ceeed0bede1c24cd284e31310a6f18e3d
MD5 0fc809e540d3759bdcbd55306473b5c3
BLAKE2b-256 0ce911ff863658403913467e68b9702a35effb672a963879bdb6dcbd54075e40

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