Update app.py
Browse files
app.py
CHANGED
|
@@ -205,12 +205,13 @@ def main():
|
|
| 205 |
|
| 206 |
if detect_watermark_button:
|
| 207 |
with st.spinner("Detecting..."):
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
|
|
|
| 212 |
|
| 213 |
-
|
| 214 |
|
| 215 |
if file_extension in [".wav", ".flac"]:
|
| 216 |
wav, sample_rate = torchaudio.load("test.wav")
|
|
@@ -225,9 +226,11 @@ def main():
|
|
| 225 |
wav= wav.unsqueeze(0)
|
| 226 |
|
| 227 |
result2, message2 = detector.detect_watermark(wav, sample_rate=default_sr, message_threshold=0.5)
|
| 228 |
-
st.markdown("This is likely an unwatermarked audio:")
|
| 229 |
print(f"This is likely an unwatermarked audio: {result2}")
|
|
|
|
|
|
|
| 230 |
st.markdown(result2)
|
|
|
|
| 231 |
|
| 232 |
|
| 233 |
if __name__ == "__main__":
|
|
|
|
| 205 |
|
| 206 |
if detect_watermark_button:
|
| 207 |
with st.spinner("Detecting..."):
|
| 208 |
+
result, message = detector.detect_watermark(watermarked_audio, sample_rate=default_sr, message_threshold=0.5)
|
| 209 |
+
st.markdown("Probability of audio being watermarked: ")
|
| 210 |
+
st.markdown(result)
|
| 211 |
+
st.markdown("This is likely a watermarked audio: ")
|
| 212 |
+
print(f"\nThis is likely a watermarked audio: {result}")
|
| 213 |
|
| 214 |
+
Run on an unwatermarked audio
|
| 215 |
|
| 216 |
if file_extension in [".wav", ".flac"]:
|
| 217 |
wav, sample_rate = torchaudio.load("test.wav")
|
|
|
|
| 226 |
wav= wav.unsqueeze(0)
|
| 227 |
|
| 228 |
result2, message2 = detector.detect_watermark(wav, sample_rate=default_sr, message_threshold=0.5)
|
|
|
|
| 229 |
print(f"This is likely an unwatermarked audio: {result2}")
|
| 230 |
+
st.markdown("Probability of audio being watermarked (Original Audio): ")
|
| 231 |
+
st.markdown(result)
|
| 232 |
st.markdown(result2)
|
| 233 |
+
st.markdown("This is likely an unwatermarked audio:")
|
| 234 |
|
| 235 |
|
| 236 |
if __name__ == "__main__":
|