Politrees commited on
Commit
fca0fa2
·
verified ·
1 Parent(s): c90ef87

Update steganography.py

Browse files
Files changed (1) hide show
  1. steganography.py +3 -5
steganography.py CHANGED
@@ -5,7 +5,6 @@ import librosa
5
  import librosa.display
6
  import gradio as gr
7
  import soundfile as sf
8
- import os
9
 
10
  # Constants
11
  DEFAULT_FONT_PATH = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
@@ -70,12 +69,11 @@ def display_audio_spectrogram(audio_path):
70
 
71
  plt.figure(figsize=(10, 4))
72
  librosa.display.specshow(S_dB, sr=sr, x_axis='time', y_axis='mel')
73
- plt.colorbar(format='%+2.0f dB')
74
- plt.title('Mel-frequency spectrogram')
75
- plt.tight_layout()
76
 
77
  spectrogram_path = 'uploaded_spectrogram.png'
78
- plt.savefig(spectrogram_path, bbox_inches='tight', pad_inches=0)
79
  plt.close()
80
  return spectrogram_path
81
 
 
5
  import librosa.display
6
  import gradio as gr
7
  import soundfile as sf
 
8
 
9
  # Constants
10
  DEFAULT_FONT_PATH = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
 
69
 
70
  plt.figure(figsize=(10, 4))
71
  librosa.display.specshow(S_dB, sr=sr, x_axis='time', y_axis='mel')
72
+ plt.axis('off') # Отключаем оси и надписи
73
+ plt.tight_layout(pad=0) # Убираем отступы
 
74
 
75
  spectrogram_path = 'uploaded_spectrogram.png'
76
+ plt.savefig(spectrogram_path, bbox_inches='tight', pad_inches=0, transparent=True) # Сохраняем без фона
77
  plt.close()
78
  return spectrogram_path
79