Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -249,7 +249,7 @@ def predict(image):
|
|
| 249 |
# Resize the image to the model's input shape
|
| 250 |
image = cv2.resize(image, (input_shape[2], input_shape[3]))
|
| 251 |
|
| 252 |
-
|
| 253 |
|
| 254 |
# Convert the image to a numpy array and add a batch dimension
|
| 255 |
if len(input_shape) == 4 and input_shape[0] == 1:
|
|
@@ -257,7 +257,7 @@ def predict(image):
|
|
| 257 |
|
| 258 |
image = image.astype(np.float32)
|
| 259 |
|
| 260 |
-
|
| 261 |
|
| 262 |
# Perform inference
|
| 263 |
output = model.run(None, {input_name: image})
|
|
|
|
| 249 |
# Resize the image to the model's input shape
|
| 250 |
image = cv2.resize(image, (input_shape[2], input_shape[3]))
|
| 251 |
|
| 252 |
+
print("after resize", image.shape)
|
| 253 |
|
| 254 |
# Convert the image to a numpy array and add a batch dimension
|
| 255 |
if len(input_shape) == 4 and input_shape[0] == 1:
|
|
|
|
| 257 |
|
| 258 |
image = image.astype(np.float32)
|
| 259 |
|
| 260 |
+
print("after expands/astype", image.shape)
|
| 261 |
|
| 262 |
# Perform inference
|
| 263 |
output = model.run(None, {input_name: image})
|