Spaces:
Runtime error
Runtime error
fixing broken predictions - debug prints enabled
Browse files- app.py +1 -1
- predict.py +2 -0
- process_audio.py +1 -0
app.py
CHANGED
@@ -35,4 +35,4 @@ demo = gr.Interface(
|
|
35 |
],
|
36 |
description=description
|
37 |
)
|
38 |
-
demo.launch(
|
|
|
35 |
],
|
36 |
description=description
|
37 |
)
|
38 |
+
demo.launch(debug=True)
|
predict.py
CHANGED
@@ -30,8 +30,10 @@ def predict_image(image, processor, model):
|
|
30 |
prediction = model.config.id2label[predicted_class_idx]
|
31 |
|
32 |
if prediction.lower() == "real":
|
|
|
33 |
return {"real": 1.0, "fake": 0.0} # 100% confidence for real
|
34 |
else: # prediction == "fake"
|
|
|
35 |
return {"real": 0.0, "fake": 1.0}
|
36 |
|
37 |
|
|
|
30 |
prediction = model.config.id2label[predicted_class_idx]
|
31 |
|
32 |
if prediction.lower() == "real":
|
33 |
+
print("real ")
|
34 |
return {"real": 1.0, "fake": 0.0} # 100% confidence for real
|
35 |
else: # prediction == "fake"
|
36 |
+
print("fake ")
|
37 |
return {"real": 0.0, "fake": 1.0}
|
38 |
|
39 |
|
process_audio.py
CHANGED
@@ -91,6 +91,7 @@ def create_mel_spectrograms(file_path, segment_duration, start_offset):
|
|
91 |
S_dB = librosa.power_to_db(S, ref=np.max)
|
92 |
|
93 |
# Setup axis
|
|
|
94 |
ax.set_xlim(0, S.shape[-1])
|
95 |
ax.set_ylim(0, S.shape[0])
|
96 |
ax.set_xticks([])
|
|
|
91 |
S_dB = librosa.power_to_db(S, ref=np.max)
|
92 |
|
93 |
# Setup axis
|
94 |
+
img = librosa.display.specshow(S_dB, sr=sr, fmax=8000, ax=ax)
|
95 |
ax.set_xlim(0, S.shape[-1])
|
96 |
ax.set_ylim(0, S.shape[0])
|
97 |
ax.set_xticks([])
|