Spaces:
Running
Running
Update steganography.py
Browse files- steganography.py +5 -10
steganography.py
CHANGED
@@ -100,10 +100,6 @@ def create_audio_with_spectrogram(
|
|
100 |
)
|
101 |
plt.close()
|
102 |
|
103 |
-
# Clean up temporary files
|
104 |
-
os.remove(audio_path)
|
105 |
-
os.remove(spectrogram_path)
|
106 |
-
|
107 |
return audio_path, spectrogram_path
|
108 |
|
109 |
|
@@ -138,20 +134,19 @@ def image_to_spectrogram_audio(image_path, sr=DEFAULT_SAMPLE_RATE):
|
|
138 |
|
139 |
|
140 |
# Gradio interface
|
141 |
-
def gradio_interface_fn(
|
142 |
-
|
143 |
-
)
|
144 |
-
audio_path, spectrogram_path = create_audio_with_spectrogram(
|
145 |
-
text, base_width, height, max_font_size, margin, letter_spacing
|
146 |
-
)
|
147 |
return audio_path, spectrogram_path
|
148 |
|
149 |
|
150 |
def gradio_image_to_audio_fn(upload_image):
|
|
|
151 |
return image_to_spectrogram_audio(upload_image)
|
152 |
|
153 |
|
154 |
def gradio_decode_fn(upload_audio):
|
|
|
155 |
return display_audio_spectrogram(upload_audio)
|
156 |
|
157 |
|
|
|
100 |
)
|
101 |
plt.close()
|
102 |
|
|
|
|
|
|
|
|
|
103 |
return audio_path, spectrogram_path
|
104 |
|
105 |
|
|
|
134 |
|
135 |
|
136 |
# Gradio interface
|
137 |
+
def gradio_interface_fn(text, base_width, height, max_font_size, margin, letter_spacing):
|
138 |
+
logging.info(f"Generating audio and spectrogram for text:\n{text}\n")
|
139 |
+
audio_path, spectrogram_path = create_audio_with_spectrogram(text, base_width, height, max_font_size, margin, letter_spacing)
|
|
|
|
|
|
|
140 |
return audio_path, spectrogram_path
|
141 |
|
142 |
|
143 |
def gradio_image_to_audio_fn(upload_image):
|
144 |
+
logging.info(f"Converting image to audio:\n{upload_image}\n")
|
145 |
return image_to_spectrogram_audio(upload_image)
|
146 |
|
147 |
|
148 |
def gradio_decode_fn(upload_audio):
|
149 |
+
logging.info(f"Generating spectrogram for audio:\n{upload_audio}\n")
|
150 |
return display_audio_spectrogram(upload_audio)
|
151 |
|
152 |
|