Zw07 commited on
Commit
5b1f262
·
verified ·
1 Parent(s): 9a62502

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -26
app.py CHANGED
@@ -346,33 +346,33 @@ def main():
346
  # # #st.markdown(size)
347
 
348
 
349
- if detect_watermark_button:
350
- with st.spinner("Detecting..."):
351
- # result, message = detector.detect_watermark(watermarked_audio, sample_rate=default_sr, message_threshold=0.5)
352
- # st.markdown("Probability of audio being watermarked: ")
353
- # st.markdown(result)
354
- # st.markdown("This is likely a watermarked audio!")
355
- # print(f"\nThis is likely a watermarked audio: {result}")
356
-
357
- #Run on an unwatermarked audio
358
-
359
- if file_extension in [".wav", ".flac"]:
360
- wav, sample_rate = torchaudio.load("test.wav")
361
- wav= wav.unsqueeze(0)
362
-
363
- elif file_extension == ".mp3":
364
- # Load an MP3 file
365
- audio = AudioSegment.from_mp3("test.mp3")
366
- # Export it as a WAV file
367
- audio.export("test.wav", format="wav")
368
- wav, sample_rate = torchaudio.load("test.wav")
369
- wav= wav.unsqueeze(0)
370
 
371
- result2, message2 = detector.detect_watermark(wav, sample_rate=default_sr, message_threshold=0.5)
372
- print(f"This is likely an unwatermarked audio: {result2}")
373
- st.markdown("Probability of audio being watermarked: ")
374
- st.markdown(result2)
375
- st.markdown("This is likely an unwatermarked audio!")
376
 
377
 
378
  if __name__ == "__main__":
 
346
  # # #st.markdown(size)
347
 
348
 
349
+ # if detect_watermark_button:
350
+ # with st.spinner("Detecting..."):
351
+ # # result, message = detector.detect_watermark(watermarked_audio, sample_rate=default_sr, message_threshold=0.5)
352
+ # # st.markdown("Probability of audio being watermarked: ")
353
+ # # st.markdown(result)
354
+ # # st.markdown("This is likely a watermarked audio!")
355
+ # # print(f"\nThis is likely a watermarked audio: {result}")
356
+
357
+ # #Run on an unwatermarked audio
358
+
359
+ # if file_extension in [".wav", ".flac"]:
360
+ # wav, sample_rate = torchaudio.load("test.wav")
361
+ # wav= wav.unsqueeze(0)
362
+
363
+ # elif file_extension == ".mp3":
364
+ # # Load an MP3 file
365
+ # audio = AudioSegment.from_mp3("test.mp3")
366
+ # # Export it as a WAV file
367
+ # audio.export("test.wav", format="wav")
368
+ # wav, sample_rate = torchaudio.load("test.wav")
369
+ # wav= wav.unsqueeze(0)
370
 
371
+ # result2, message2 = detector.detect_watermark(wav, sample_rate=default_sr, message_threshold=0.5)
372
+ # print(f"This is likely an unwatermarked audio: {result2}")
373
+ # st.markdown("Probability of audio being watermarked: ")
374
+ # st.markdown(result2)
375
+ # st.markdown("This is likely an unwatermarked audio!")
376
 
377
 
378
  if __name__ == "__main__":