Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -256,8 +256,6 @@ def predict(image):
|
|
| 256 |
std = np.expand_dims(std, axis=(1,2))
|
| 257 |
|
| 258 |
image = (image / 255.0 - mean)/std
|
| 259 |
-
|
| 260 |
-
print("normalized image:", image.shape)
|
| 261 |
|
| 262 |
# Convert the image to a numpy array and add a batch dimension
|
| 263 |
if len(input_shape) == 4 and input_shape[0] == 1:
|
|
@@ -268,9 +266,11 @@ def predict(image):
|
|
| 268 |
# Perform inference
|
| 269 |
output = model.run(None, {input_name: image})
|
| 270 |
# print(type(output))
|
| 271 |
-
print(
|
|
|
|
|
|
|
| 272 |
|
| 273 |
-
return
|
| 274 |
|
| 275 |
# Gradio interface
|
| 276 |
demo = gr.Interface(
|
|
|
|
| 256 |
std = np.expand_dims(std, axis=(1,2))
|
| 257 |
|
| 258 |
image = (image / 255.0 - mean)/std
|
|
|
|
|
|
|
| 259 |
|
| 260 |
# Convert the image to a numpy array and add a batch dimension
|
| 261 |
if len(input_shape) == 4 and input_shape[0] == 1:
|
|
|
|
| 266 |
# Perform inference
|
| 267 |
output = model.run(None, {input_name: image})
|
| 268 |
# print(type(output))
|
| 269 |
+
print(output)
|
| 270 |
+
|
| 271 |
+
annotated_img = output[0]
|
| 272 |
|
| 273 |
+
return annotated_img
|
| 274 |
|
| 275 |
# Gradio interface
|
| 276 |
demo = gr.Interface(
|