Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -277,12 +277,16 @@ def predict(image):
|
|
277 |
# Postprocess output image
|
278 |
|
279 |
annotated_img = output[0]
|
|
|
|
|
|
|
|
|
280 |
|
281 |
# annotated_img = (output[0] / 255.0 - mean)/std
|
282 |
# annotated_img = classes[output[0][0].argmax(0)]
|
283 |
|
284 |
print("Annotated image type before normalization:", type(annotated_img))
|
285 |
-
print("annotated_img shape before normalization:", annotated_img.shape)
|
286 |
# print("Annotated image before normalization:", annotated_img)
|
287 |
print("Min value of image before normalization:", np.min(annotated_img))
|
288 |
print("Max value of image before normalization:", np.max(annotated_img))
|
|
|
277 |
# Postprocess output image
|
278 |
|
279 |
annotated_img = output[0]
|
280 |
+
|
281 |
+
# Reshape the image to match the PIL Image input shape
|
282 |
+
annotated_img = annotated_img.reshape(640, 640, 3)
|
283 |
+
print("annotated_img shape after reshape:", annotated_img.shape)
|
284 |
|
285 |
# annotated_img = (output[0] / 255.0 - mean)/std
|
286 |
# annotated_img = classes[output[0][0].argmax(0)]
|
287 |
|
288 |
print("Annotated image type before normalization:", type(annotated_img))
|
289 |
+
# print("annotated_img shape before normalization:", annotated_img.shape)
|
290 |
# print("Annotated image before normalization:", annotated_img)
|
291 |
print("Min value of image before normalization:", np.min(annotated_img))
|
292 |
print("Max value of image before normalization:", np.max(annotated_img))
|