Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,25 +19,10 @@ def voice_to_emotion(audio):
|
|
19 |
res = str(each['label'])
|
20 |
return res
|
21 |
|
22 |
-
|
23 |
fn=voice_to_emotion,
|
24 |
inputs = input_audio,
|
25 |
-
outputs = "textbox")
|
26 |
-
|
27 |
-
#demo.launch()
|
28 |
-
|
29 |
-
pipeline2 = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
30 |
-
|
31 |
-
def predict(input_img):
|
32 |
-
predictions = pipeline2(input_img)
|
33 |
-
return input_img, {p["label"]: p["score"] for p in predictions}
|
34 |
-
|
35 |
-
gradio_app = gr.Interface(
|
36 |
-
predict,
|
37 |
-
inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
|
38 |
-
outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
|
39 |
-
title="Hot Dog? Or Not?",
|
40 |
-
)
|
41 |
|
42 |
if __name__ == "__main__":
|
43 |
-
|
|
|
19 |
res = str(each['label'])
|
20 |
return res
|
21 |
|
22 |
+
demo = gr.Interface(
|
23 |
fn=voice_to_emotion,
|
24 |
inputs = input_audio,
|
25 |
+
outputs = "textbox")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
if __name__ == "__main__":
|
28 |
+
demo.launch()
|