Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,9 @@ with gr.Blocks() as demo:
|
|
22 |
# image classification model for
|
23 |
# clothes images
|
24 |
def modelTraining(img):
|
|
|
|
|
|
|
25 |
# clothing dataset
|
26 |
mnist = tf.keras.datasets.mnist
|
27 |
|
@@ -72,9 +75,9 @@ with gr.Blocks() as demo:
|
|
72 |
|
73 |
# Make a prediction using the model
|
74 |
prediction = probability_model.predict(input_array)
|
75 |
-
|
76 |
# Postprocess the prediction and return it
|
77 |
-
return
|
78 |
|
79 |
|
80 |
# Creates the Gradio interface objects
|
|
|
22 |
# image classification model for
|
23 |
# clothes images
|
24 |
def modelTraining(img):
|
25 |
+
class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',
|
26 |
+
'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']
|
27 |
+
|
28 |
# clothing dataset
|
29 |
mnist = tf.keras.datasets.mnist
|
30 |
|
|
|
75 |
|
76 |
# Make a prediction using the model
|
77 |
prediction = probability_model.predict(input_array)
|
78 |
+
predicted_label = class_names[np.argmax(prediction)]
|
79 |
# Postprocess the prediction and return it
|
80 |
+
return predicted_label
|
81 |
|
82 |
|
83 |
# Creates the Gradio interface objects
|