Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,8 +66,8 @@ def seprate_speaker(audio_file, pipeline):
|
|
| 66 |
for speaker, segments in speaker_segments.items():
|
| 67 |
# ํ์์ ๋ชจ๋ ๋ฐํ ๊ตฌ๊ฐ์ ์ด์ด๋ถ์
|
| 68 |
combined_waveform = torch.cat(segments, dim=1)
|
| 69 |
-
current_path = os.getcwd()
|
| 70 |
-
output_path =
|
| 71 |
os.makedirs(output_path, exist_ok=True) # ๊ฒฝ๋ก๊ฐ ์์ผ๋ฉด ์์ฑ
|
| 72 |
output_filename = os.path.join(output_path,f"{speaker}.wav")
|
| 73 |
|
|
@@ -138,8 +138,8 @@ def main(file_name):
|
|
| 138 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 139 |
|
| 140 |
video_file = file_name #deepfake #meganfox.mp4'
|
| 141 |
-
current_path = os.getcwd()
|
| 142 |
-
audio_file =
|
| 143 |
|
| 144 |
extract_audio_from_video(video_file, audio_file)
|
| 145 |
|
|
@@ -164,8 +164,8 @@ def main(file_name):
|
|
| 164 |
#real_path = '/content/drive/MyDrive/Celeb-DF-v2/Celeb-real'
|
| 165 |
|
| 166 |
#real = os.listdir(real_path)
|
| 167 |
-
current_path = os.getcwd()
|
| 168 |
-
fake_path =
|
| 169 |
fake = os.listdir(fake_path)
|
| 170 |
|
| 171 |
rf_check = real_fake_check(fake, fake_path,model) #fake dataset\
|
|
|
|
| 66 |
for speaker, segments in speaker_segments.items():
|
| 67 |
# ํ์์ ๋ชจ๋ ๋ฐํ ๊ตฌ๊ฐ์ ์ด์ด๋ถ์
|
| 68 |
combined_waveform = torch.cat(segments, dim=1)
|
| 69 |
+
#current_path = os.getcwd()
|
| 70 |
+
output_path = "/tmp/wav" # ๊ฒฝ๋ก
|
| 71 |
os.makedirs(output_path, exist_ok=True) # ๊ฒฝ๋ก๊ฐ ์์ผ๋ฉด ์์ฑ
|
| 72 |
output_filename = os.path.join(output_path,f"{speaker}.wav")
|
| 73 |
|
|
|
|
| 138 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 139 |
|
| 140 |
video_file = file_name #deepfake #meganfox.mp4'
|
| 141 |
+
#current_path = os.getcwd()
|
| 142 |
+
audio_file = '/tmp/output_audio.wav' # ์ ์ฅํ ์ค๋์ค ํ์ผ์ ๊ฒฝ๋ก, ์ด๋ฆ ์ง์
|
| 143 |
|
| 144 |
extract_audio_from_video(video_file, audio_file)
|
| 145 |
|
|
|
|
| 164 |
#real_path = '/content/drive/MyDrive/Celeb-DF-v2/Celeb-real'
|
| 165 |
|
| 166 |
#real = os.listdir(real_path)
|
| 167 |
+
#current_path = os.getcwd()
|
| 168 |
+
fake_path = '/tmp/wav'
|
| 169 |
fake = os.listdir(fake_path)
|
| 170 |
|
| 171 |
rf_check = real_fake_check(fake, fake_path,model) #fake dataset\
|