Spaces:
Paused
Paused
update
Browse files- .gitignore +1 -1
- examples/sound_classification_by_lstm/run.sh +1 -2
- tabs/event_tab.py +1 -7
.gitignore
CHANGED
|
@@ -12,7 +12,7 @@
|
|
| 12 |
/docs/
|
| 13 |
/dotenv/
|
| 14 |
/examples/**/*.wav
|
| 15 |
-
/trained_models/
|
| 16 |
/temp/
|
| 17 |
|
| 18 |
**/*.csv
|
|
|
|
| 12 |
/docs/
|
| 13 |
/dotenv/
|
| 14 |
/examples/**/*.wav
|
| 15 |
+
/trained_models*/
|
| 16 |
/temp/
|
| 17 |
|
| 18 |
**/*.csv
|
examples/sound_classification_by_lstm/run.sh
CHANGED
|
@@ -187,8 +187,7 @@ if [ ${stage} -le 6 ] && [ ${stop_stage} -ge 6 ]; then
|
|
| 187 |
cp "${evaluation_file}" "${final_model_dir}/evaluation.xlsx"
|
| 188 |
cp "${evaluation_onnx_file}" "${final_model_dir}/evaluation-onnx.xlsx"
|
| 189 |
|
| 190 |
-
cp "${
|
| 191 |
-
cp "${onnx_model_file}" "${onnx_model_file}"
|
| 192 |
|
| 193 |
cp "${file_dir}/trace_model.zip" "${final_model_dir}/trace_model.zip"
|
| 194 |
cp "${file_dir}/trace_quant_model.zip" "${final_model_dir}/trace_quant_model.zip"
|
|
|
|
| 187 |
cp "${evaluation_file}" "${final_model_dir}/evaluation.xlsx"
|
| 188 |
cp "${evaluation_onnx_file}" "${final_model_dir}/evaluation-onnx.xlsx"
|
| 189 |
|
| 190 |
+
cp "${onnx_model_file}" "${final_model_dir}"
|
|
|
|
| 191 |
|
| 192 |
cp "${file_dir}/trace_model.zip" "${final_model_dir}/trace_model.zip"
|
| 193 |
cp "${file_dir}/trace_quant_model.zip" "${final_model_dir}/trace_quant_model.zip"
|
tabs/event_tab.py
CHANGED
|
@@ -198,16 +198,10 @@ def when_click_event_button_by_lstm_model(audio_t,
|
|
| 198 |
waveform_ = inputs[:, begin:end]
|
| 199 |
if waveform_.shape[-1] < win_size:
|
| 200 |
break
|
| 201 |
-
spec = wave_to_mel_spectrogram(waveform_) + 1e-6
|
| 202 |
-
spec = spec.log()
|
| 203 |
-
# shape = [b, f, t]
|
| 204 |
-
spec = spec.transpose(1, 2)
|
| 205 |
-
# shape = [b, t, f]
|
| 206 |
-
sub_inputs = spec
|
| 207 |
|
| 208 |
# infer
|
| 209 |
input_feed = {
|
| 210 |
-
"inputs":
|
| 211 |
"h": h,
|
| 212 |
"c": c,
|
| 213 |
}
|
|
|
|
| 198 |
waveform_ = inputs[:, begin:end]
|
| 199 |
if waveform_.shape[-1] < win_size:
|
| 200 |
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
# infer
|
| 203 |
input_feed = {
|
| 204 |
+
"inputs": waveform_.numpy(),
|
| 205 |
"h": h,
|
| 206 |
"c": c,
|
| 207 |
}
|