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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for fasr_enhancement_gtcrn-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 90d7cee729d7f23c4f84e3361ecca7bbbc3151201e5ca81362fb6eea428a188f
MD5 c2080903f4a4c0578ca97802f4b43578
BLAKE2b-256 9dd424191a58a70249a650e82a9dad2a71d46d20bc9f3af107e70240eb2ca719

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