Spaces:
Sleeping
Sleeping
Adding a title and description
Browse files
app.py
CHANGED
@@ -7,7 +7,9 @@ def predict(img):
|
|
7 |
pred,pred_idx,probs = learn.predict(img)
|
8 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
9 |
|
|
|
|
|
10 |
examples = ["angryExample.jpg", "disgustExample.jpg", "fearExample.jpg", "happyExample.jpg", "neutralExample.jpg", "sadExample.jpg", "surpriseExample.jpg"]
|
11 |
-
iface = gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(48,48)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples)
|
12 |
iface.launch()
|
13 |
|
|
|
7 |
pred,pred_idx,probs = learn.predict(img)
|
8 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
9 |
|
10 |
+
title = "Facial Expression Classifier"
|
11 |
+
description = "A facial expression classifier, trained using the <a href='https://www.kaggle.com/datasets/msambare/fer2013'>FER-2013 dataset</a>. This dataset consists of 28,709 examples of faces: each one is 48x48 grayscale pixels and is labelled with one of the following expressions: anger, disgust, fear, happy, neutral, sad, surprise.<p><p>This was used to train a resnet34 model."
|
12 |
examples = ["angryExample.jpg", "disgustExample.jpg", "fearExample.jpg", "happyExample.jpg", "neutralExample.jpg", "sadExample.jpg", "surpriseExample.jpg"]
|
13 |
+
iface = gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(48,48)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples, title=title, description=description)
|
14 |
iface.launch()
|
15 |
|