Spaces:
Runtime error
Runtime error
Fixing prob type
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ def preprocess(image):
|
|
| 19 |
return image / 255.
|
| 20 |
|
| 21 |
def postprocess(prediction):
|
| 22 |
-
return {labels[i]: prediction[i] for i in range(len(labels))}
|
| 23 |
# return {labels[i]: 0 for i in range(len(labels))}
|
| 24 |
|
| 25 |
def predict_fn(image):
|
|
@@ -29,7 +29,7 @@ def predict_fn(image):
|
|
| 29 |
print(prediction)
|
| 30 |
try:
|
| 31 |
print("default")
|
| 32 |
-
print({labels[i]: prediction[i] for i in range(len(labels))})
|
| 33 |
except:
|
| 34 |
print("default gives error")
|
| 35 |
print('****************')
|
|
|
|
| 19 |
return image / 255.
|
| 20 |
|
| 21 |
def postprocess(prediction):
|
| 22 |
+
return {labels[i]: float(prediction[i]) for i in range(len(labels))}
|
| 23 |
# return {labels[i]: 0 for i in range(len(labels))}
|
| 24 |
|
| 25 |
def predict_fn(image):
|
|
|
|
| 29 |
print(prediction)
|
| 30 |
try:
|
| 31 |
print("default")
|
| 32 |
+
print({labels[i]: float(prediction[i]) for i in range(len(labels))})
|
| 33 |
except:
|
| 34 |
print("default gives error")
|
| 35 |
print('****************')
|