Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ compiled_model = ie.compile_model(model=model, device_name="CPU")
|
|
13 |
input_layer = compiled_model.input(0)
|
14 |
output_layer = compiled_model.output(0)
|
15 |
|
16 |
-
#
|
17 |
def predict(image):
|
18 |
# Preprocess the image
|
19 |
image_resized = cv2.resize(image, (input_layer.shape[-2], input_layer.shape[-1]))
|
@@ -22,8 +22,7 @@ def predict(image):
|
|
22 |
# Run inference
|
23 |
result = compiled_model([input_image])[output_layer]
|
24 |
|
25 |
-
# Process the result
|
26 |
-
# Here we assume the result is a list of detected boxes and scores
|
27 |
detected_boxes = result[:, :4]
|
28 |
scores = result[:, 4]
|
29 |
|
|
|
13 |
input_layer = compiled_model.input(0)
|
14 |
output_layer = compiled_model.output(0)
|
15 |
|
16 |
+
# Function to process the image and make predictions
|
17 |
def predict(image):
|
18 |
# Preprocess the image
|
19 |
image_resized = cv2.resize(image, (input_layer.shape[-2], input_layer.shape[-1]))
|
|
|
22 |
# Run inference
|
23 |
result = compiled_model([input_image])[output_layer]
|
24 |
|
25 |
+
# Process the result
|
|
|
26 |
detected_boxes = result[:, :4]
|
27 |
scores = result[:, 4]
|
28 |
|