Spaces:
Sleeping
Sleeping
Commit
·
41db51b
1
Parent(s):
bf43eb6
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,6 @@ 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 |
-
print(prediction)
|
50 |
return prediction
|
51 |
|
52 |
# UI Design
|
@@ -58,9 +57,9 @@ def predict_class(image):
|
|
58 |
def classify_image(image):
|
59 |
results = predict_class(image)
|
60 |
output = {}
|
61 |
-
for prediction in results:
|
62 |
-
predicted_label =
|
63 |
-
score = prediction[
|
64 |
output[predicted_label] = score
|
65 |
return output
|
66 |
|
|
|
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
|
|
|
57 |
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
|
65 |
|