From b5d3df75cf6462aa3bf42fd3c86fa2aa7f1c8a15 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 24 十一月 2023 00:54:44 +0800
Subject: [PATCH] setup jamo
---
funasr/bin/diar_inference_launch.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/funasr/bin/diar_inference_launch.py b/funasr/bin/diar_inference_launch.py
index c065137..f5a11b1 100755
--- a/funasr/bin/diar_inference_launch.py
+++ b/funasr/bin/diar_inference_launch.py
@@ -15,7 +15,8 @@
from typing import Union
import numpy as np
-import soundfile
+# import librosa
+import librosa
import torch
from scipy.signal import medfilt
@@ -144,7 +145,9 @@
# read waveform file
example = [load_bytes(x) if isinstance(x, bytes) else x
for x in example]
- example = [soundfile.read(x)[0] if isinstance(x, str) else x
+ # example = [librosa.load(x)[0] if isinstance(x, str) else x
+ # for x in example]
+ example = [librosa.load(x, dtype='float32')[0] if isinstance(x, str) else x
for x in example]
# convert torch tensor to numpy array
example = [x.numpy() if isinstance(example[0], torch.Tensor) else x
@@ -453,11 +456,17 @@
help="The batch size for inference",
)
group.add_argument(
- "--diar_smooth_size",
+ "--smooth_size",
type=int,
default=121,
help="The smoothing size for post-processing"
)
+ group.add_argument(
+ "--dur_threshold",
+ type=int,
+ default=10,
+ help="The threshold of minimum duration"
+ )
return parser
--
Gitblit v1.9.1