Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
CHANGED
|
@@ -53,7 +53,9 @@ def classify_image(img):
|
|
| 53 |
img = tf.convert_to_tensor(img, dtype=tf.float32)
|
| 54 |
img = tf.expand_dims(img, axis=0)
|
| 55 |
# pred,idx,probs = model.predict(img)
|
| 56 |
-
probs = model.predict(img)
|
|
|
|
|
|
|
| 57 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 58 |
|
| 59 |
image = gr.inputs.Image(shape=(256, 256))
|
|
|
|
| 53 |
img = tf.convert_to_tensor(img, dtype=tf.float32)
|
| 54 |
img = tf.expand_dims(img, axis=0)
|
| 55 |
# pred,idx,probs = model.predict(img)
|
| 56 |
+
probs = model.predict(img).flatten()
|
| 57 |
+
# vector = np.vectorize(np.float_)
|
| 58 |
+
# probs = vector(probs)
|
| 59 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 60 |
|
| 61 |
image = gr.inputs.Image(shape=(256, 256))
|