ongkn commited on
Commit
13abd50
·
1 Parent(s): f2fe399

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -1,13 +1,3 @@
1
  import gradio as gr
2
 
3
- def predict_and_label(inp):
4
- print("Warning: you need to extract a face and resize it to (224, 224) before accurate results can be achieved!")
5
- iface = gr.Interface.load("models/ongkn/attraction-classifier")
6
- result = iface.predict(inp)
7
- # Assuming result is a dictionary with class labels as keys and probabilities as values
8
- max_label = max(result, key=result.get)
9
- print(max_label)
10
- return result
11
-
12
- iface = gr.Interface(fn=predict_and_label, inputs=gr.inputs.Image(), outputs="label")
13
- iface.launch()
 
1
  import gradio as gr
2
 
3
+ gr.Interface.load("models/ongkn/attraction-classifier").launch()