Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,10 @@ from pydub import AudioSegment # 変換用にpydubをインポート
|
|
4 |
import os
|
5 |
import shutil
|
6 |
from process import AudioProcessor
|
|
|
7 |
|
8 |
process=AudioProcessor()
|
|
|
9 |
app = Flask(__name__)
|
10 |
|
11 |
users = []
|
@@ -71,9 +73,11 @@ def upload_audio():
|
|
71 |
# 複数人の場合は参照パスのリストを、1人の場合は単一のパスを渡す
|
72 |
if len(users) > 1:
|
73 |
print("複数人の場合の処理")
|
74 |
-
matched_time, unmatched_time = process.process_multi_audio(reference_paths, audio_path, threshold=0.05)
|
|
|
75 |
else:
|
76 |
-
matched_time, unmatched_time = process.process_audio(reference_paths[0], audio_path, threshold=0.05)
|
|
|
77 |
|
78 |
total_time = matched_time + unmatched_time
|
79 |
rate = (matched_time / total_time) * 100 if total_time > 0 else 0
|
|
|
4 |
import os
|
5 |
import shutil
|
6 |
from process import AudioProcessor
|
7 |
+
from transcription import TranscriptionMaker
|
8 |
|
9 |
process=AudioProcessor()
|
10 |
+
transcription = TranscriptionMaker()
|
11 |
app = Flask(__name__)
|
12 |
|
13 |
users = []
|
|
|
73 |
# 複数人の場合は参照パスのリストを、1人の場合は単一のパスを渡す
|
74 |
if len(users) > 1:
|
75 |
print("複数人の場合の処理")
|
76 |
+
matched_time, unmatched_time,segments_dir = process.process_multi_audio(reference_paths, audio_path, threshold=0.05)
|
77 |
+
transcription.create_transcription(segments_dir)
|
78 |
else:
|
79 |
+
matched_time, unmatched_time, matched_segments_dir = process.process_audio(reference_paths[0], audio_path, threshold=0.05)
|
80 |
+
transcription.create_transcription(matched_segments_dir)
|
81 |
|
82 |
total_time = matched_time + unmatched_time
|
83 |
rate = (matched_time / total_time) * 100 if total_time > 0 else 0
|