[O] Add note when reporting results

This commit is contained in:
Hykilpikonna
2021-12-22 22:23:54 -05:00
parent ed0db78242
commit 80377e1f99
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -51,7 +51,10 @@ def process_audio(message: Message):
# Draw results
with draw_result(str(file), result) as buf:
f, m, o = get_result_percentages(result)
msg = f"分析结果: {f*100:.0f}% 🙋‍♀️ | {m*100:.0f}% 🙋‍♂️ | {o*100:.0f}% 🚫"
msg = f"分析结果: {f*100:.0f}% 🙋‍♀️ | {m*100:.0f}% 🙋‍♂️ | {o*100:.0f}% 🚫\n" \
f"(结果仅供参考, 如果结果不是你想要的,那就是模型的问题,欢迎反馈)\n" \
f"" \
f"(因为这个模型基于法语数据, 和中文发音习惯有差异, 所以这个识别结果可能不准)"
bot.send_photo(message.chat_id, photo=buf, caption=msg,
reply_to_message_id=message.message_id)
+3 -3
View File
@@ -7,6 +7,8 @@ import sys
import tempfile
import time
import wave
from dataclasses import dataclass
from PIL import Image
from subprocess import Popen, PIPE
from typing import NamedTuple, Callable
@@ -94,8 +96,6 @@ def to_wav(file: str, callback: Callable, start_sec: float = 0, stop_sec: float
output, error = p.communicate()
assert p.returncode == 0, error
shutil.copy2(tmp_wav, './test_leohearts.wav')
return callback(tmp_wav)
@@ -190,6 +190,6 @@ def get_result_percentages(result: Result) -> tuple[float, float, float]:
# # print(process(seg, ['../test.mp3']))
if __name__ == '__main__':
to_wav('../audio_tmp/2021-12-22 05-32 leph1art5.mp3', print)
# to_wav('../audio_tmp/2021-12-22 05-32 leph1art5.mp3', print)
# test()
pass