AIOmarRehan commited on
Commit
2fc5594
·
verified ·
1 Parent(s): afb665f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -121,7 +121,7 @@ interface = gr.Interface(
121
  gr.Audio(type="filepath", label="Upload Audio (WAV/MP3)"),
122
  gr.Image(type="pil", label="Upload Spectrogram Image (PNG RGBA Supported)"),
123
  gr.Checkbox(label="Pick Random Audio from Dataset"),
124
- gr.Checkbox(label="Pick Random Image from Dataset"),
125
  ],
126
  outputs=[
127
  gr.JSON(label="Prediction Results"),
@@ -129,9 +129,13 @@ interface = gr.Interface(
129
  ],
130
  title="General Audio Classifier (Audio + Spectrogram Support)",
131
  description=(
132
- "Upload a raw audio file OR a spectrogram image.\n"
133
- "You can also select random samples from your Hugging Face datasets.\n"
134
- "The output shows a JSON with all details and a separate field for the final label."
 
 
 
 
135
  ),
136
  )
137
 
 
121
  gr.Audio(type="filepath", label="Upload Audio (WAV/MP3)"),
122
  gr.Image(type="pil", label="Upload Spectrogram Image (PNG RGBA Supported)"),
123
  gr.Checkbox(label="Pick Random Audio from Dataset"),
124
+ gr.Checkbox(label="Pick Random Mel Spectrogram Image from Dataset"),
125
  ],
126
  outputs=[
127
  gr.JSON(label="Prediction Results"),
 
129
  ],
130
  title="General Audio Classifier (Audio + Spectrogram Support)",
131
  description=(
132
+ "\nUpload a raw audio file OR a spectrogram image.\n"
133
+ "\nYou can also select random samples from your Hugging Face datasets.\n"
134
+ "\nThe output shows a JSON with all details and a separate field for the final label.\n"
135
+ "\nYour audio is split into 5-second chunks. Each chunk is converted into a Mel-spectrogram and passed through a CNN trained to recognize patterns in frequency and time.
136
+ The model predicts a label for every chunk.
137
+ The final result is chosen by majority vote, using confidence scores to break ties.
138
+ The output shows the final label, its confidence, and the predictions for each chunk.\n"
139
  ),
140
  )
141