sssssungk commited on
Commit
a423d08
ยท
verified ยท
1 Parent(s): e31fd8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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 = current_path+"/wav" # ๊ฒฝ๋กœ
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 = current_path+'/output_audio.wav' # ์ €์žฅํ•  ์˜ค๋””์˜ค ํŒŒ์ผ์˜ ๊ฒฝ๋กœ, ์ด๋ฆ„ ์ง€์ •
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 = current_path+'/wav'
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\