ldhldh commited on
Commit
efae594
โ€ข
1 Parent(s): 8b6c9e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -16
app.py CHANGED
@@ -194,28 +194,39 @@ st.markdown("github : https://github.com/ldh-Hoon/ko_deepfake-whisper-features")
194
 
195
  tab1, tab2, tab3 = st.tabs(["YouTube URL", "ํŒŒ์ผ ์—…๋กœ๋“œ", "์‹ค์‹œ๊ฐ„ ์˜ค๋””์˜ค ์ž…๋ ฅ"])
196
 
197
- with tab1:
198
- youtube_url = st.text_input("YouTube URL")
199
- st.markdown("""example
200
- >fake:
201
-
202
- https://youtu.be/ha3gfD7S0_E
203
 
204
- https://youtu.be/5lmJ0Rhr-ec
 
 
 
205
 
206
- https://youtu.be/q6ra0KDgVbg
 
207
 
208
- https://youtu.be/hfmm1Oo6SSY?feature=shared
209
-
210
- >real:
 
 
 
 
211
 
212
- https://youtu.be/54y1sYLZjqs
 
 
 
 
213
 
214
- https://youtu.be/7qT0Stb3QNY
215
 
216
- """)
217
  if youtube_url:
218
- result = pred_from_url(youtube_url)
219
  st.text_area("๊ฒฐ๊ณผ", value=result, height=150)
220
  st.video(youtube_url)
221
 
@@ -238,4 +249,4 @@ with tab3:
238
  f.write(wav_audio_data)
239
  result = pred_from_file(file)
240
  st.text_area("๊ฒฐ๊ณผ", value=result, height=150)
241
- os.remove(file) # ์ž„์‹œ ํŒŒ์ผ ์‚ญ์ œ
 
194
 
195
  tab1, tab2, tab3 = st.tabs(["YouTube URL", "ํŒŒ์ผ ์—…๋กœ๋“œ", "์‹ค์‹œ๊ฐ„ ์˜ค๋””์˜ค ์ž…๋ ฅ"])
196
 
197
+ example_urls_fake = [
198
+ "https://youtu.be/ha3gfD7S0_E",
199
+ "https://youtu.be/5lmJ0Rhr-ec",
200
+ "https://youtu.be/q6ra0KDgVbg",
201
+ "https://youtu.be/hfmm1Oo6SSY?feature=shared"
202
+ ]
203
 
204
+ example_urls_real = [
205
+ "https://youtu.be/54y1sYLZjqs",
206
+ "https://youtu.be/7qT0Stb3QNY",
207
+ ]
208
 
209
+ if 'youtube_url' not in st.session_state:
210
+ st.session_state['youtube_url'] = ''
211
 
212
+ with tab1:
213
+ st.markdown("""example
214
+ >fake:
215
+ """)
216
+ for url in example_urls_fake:
217
+ if st.button(url, key=url):
218
+ st.session_state.youtube_url = url
219
 
220
+ st.markdown(""">real:
221
+ """)
222
+ for url in example_urls_real:
223
+ if st.button(url, key=url):
224
+ st.session_state.youtube_url = url
225
 
226
+ youtube_url = st.text_input("YouTube URL", value=st.session_state.youtube_url)
227
 
 
228
  if youtube_url:
229
+ result = pred_from_url(youtube_url) # ์—ฌ๊ธฐ์— pred_from_url ํ•จ์ˆ˜ ์ •์˜๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
230
  st.text_area("๊ฒฐ๊ณผ", value=result, height=150)
231
  st.video(youtube_url)
232
 
 
249
  f.write(wav_audio_data)
250
  result = pred_from_file(file)
251
  st.text_area("๊ฒฐ๊ณผ", value=result, height=150)
252
+ os.remove(file)