Spaces:
Runtime error
Runtime error
Post process debug
Browse files
app.py
CHANGED
|
@@ -24,15 +24,19 @@ def postprocess(prediction):
|
|
| 24 |
|
| 25 |
def predict_fn(image):
|
| 26 |
image = preprocess(image)
|
| 27 |
-
prediction = model(image)
|
| 28 |
print('****************')
|
| 29 |
print(prediction)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
print('****************')
|
| 31 |
-
print(prediction
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
scores = postprocess(prediction)
|
| 37 |
return scores
|
| 38 |
|
|
|
|
| 24 |
|
| 25 |
def predict_fn(image):
|
| 26 |
image = preprocess(image)
|
| 27 |
+
prediction = model(image)[0].numpy()
|
| 28 |
print('****************')
|
| 29 |
print(prediction)
|
| 30 |
+
try:
|
| 31 |
+
print({labels[i]: prediction[i] for i in range(len(labels))})
|
| 32 |
+
except:
|
| 33 |
+
print("default gives error")
|
| 34 |
print('****************')
|
| 35 |
+
print(list(prediction))
|
| 36 |
+
try:
|
| 37 |
+
print({labels[i]: list(prediction)[i] for i in range(len(labels))})
|
| 38 |
+
except:
|
| 39 |
+
print("list gives error")
|
| 40 |
scores = postprocess(prediction)
|
| 41 |
return scores
|
| 42 |
|