Spaces:
Runtime error
Runtime error
Output log
Browse files
app.py
CHANGED
|
@@ -19,14 +19,20 @@ 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 |
|
| 24 |
def predict_fn(image):
|
| 25 |
image = preprocess(image)
|
| 26 |
-
prediction = model(image)
|
| 27 |
-
print(
|
| 28 |
-
print(model(image).numpy())
|
| 29 |
print(prediction)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
scores = postprocess(prediction)
|
| 31 |
return scores
|
| 32 |
|
|
|
|
| 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):
|
| 26 |
image = preprocess(image)
|
| 27 |
+
prediction = model(image)
|
| 28 |
+
print('****************')
|
|
|
|
| 29 |
print(prediction)
|
| 30 |
+
print('****************')
|
| 31 |
+
print(prediction[0])
|
| 32 |
+
print('****************')
|
| 33 |
+
print(prediction[0].numpy())
|
| 34 |
+
print('****************')
|
| 35 |
+
print(prediction.numpy())
|
| 36 |
scores = postprocess(prediction)
|
| 37 |
return scores
|
| 38 |
|