Spaces:
Build error
Build error
Commit
·
602f825
1
Parent(s):
e8e545e
add files
Browse files
app.py
CHANGED
@@ -35,12 +35,12 @@ def preprocess_image(img_array):
|
|
35 |
return img_array
|
36 |
|
37 |
|
38 |
-
def inference(
|
39 |
img = preprocess_image(img)
|
40 |
preds = model.predict(img)
|
41 |
img = np.expand_dims(img, 0)
|
42 |
# Predict
|
43 |
-
preds = model.predict(
|
44 |
labels_probs = {labels[i]: float(preds[i]) for i, _ in enumerate(labels)}
|
45 |
return labels_probs
|
46 |
|
|
|
35 |
return img_array
|
36 |
|
37 |
|
38 |
+
def inference(img):
|
39 |
img = preprocess_image(img)
|
40 |
preds = model.predict(img)
|
41 |
img = np.expand_dims(img, 0)
|
42 |
# Predict
|
43 |
+
preds = model.predict(img)[0]
|
44 |
labels_probs = {labels[i]: float(preds[i]) for i, _ in enumerate(labels)}
|
45 |
return labels_probs
|
46 |
|