Spaces:
Sleeping
Sleeping
Commit
·
d7e0cf7
1
Parent(s):
41db51b
Update app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,7 @@ def predict_class(image):
|
|
46 |
img = tf.image.resize(img, [input_shape[0], input_shape[1]])
|
47 |
img = tf.expand_dims(img, axis=0)
|
48 |
prediction = model.predict(img)
|
|
|
49 |
return prediction
|
50 |
|
51 |
# UI Design
|
@@ -58,7 +59,7 @@ def classify_image(image):
|
|
58 |
results = predict_class(image)
|
59 |
output = {}
|
60 |
for _, prediction in enumerate(results):
|
61 |
-
predicted_label = labels
|
62 |
score = prediction[_]
|
63 |
output[predicted_label] = score
|
64 |
return output
|
|
|
46 |
img = tf.image.resize(img, [input_shape[0], input_shape[1]])
|
47 |
img = tf.expand_dims(img, axis=0)
|
48 |
prediction = model.predict(img)
|
49 |
+
print(prediction[0])
|
50 |
return prediction
|
51 |
|
52 |
# UI Design
|
|
|
59 |
results = predict_class(image)
|
60 |
output = {}
|
61 |
for _, prediction in enumerate(results):
|
62 |
+
predicted_label = labels.get(_)
|
63 |
score = prediction[_]
|
64 |
output[predicted_label] = score
|
65 |
return output
|