Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -126,9 +126,9 @@ def inference(image_url, image, min_score):
|
|
126 |
# )
|
127 |
# v = v.draw_instance_predictions(outputs["instances"].to("cpu"))
|
128 |
# cv2_imshow(v.get_image()[:, :, ::-1])
|
129 |
-
print(outputs["instances"])
|
130 |
masks = np.asarray(outputs["instances"].pred_masks.to("cpu"))
|
131 |
-
bbox = np.asarray(outputs["instances"].pred_boxes.to("cpu"))
|
132 |
|
133 |
# Pick an item to mask
|
134 |
# img=v.get_image()
|
@@ -137,7 +137,7 @@ def inference(image_url, image, min_score):
|
|
137 |
measurements = {}
|
138 |
|
139 |
for ind,item_mask in enumerate(masks):
|
140 |
-
box=bbox[ind]
|
141 |
# Get the true bounding box of the mask (not the same as the bbox prediction)
|
142 |
segmentation = np.where(item_mask == True)
|
143 |
x_min = int(np.min(segmentation[1]))
|
|
|
126 |
# )
|
127 |
# v = v.draw_instance_predictions(outputs["instances"].to("cpu"))
|
128 |
# cv2_imshow(v.get_image()[:, :, ::-1])
|
129 |
+
# print(outputs["instances"])
|
130 |
masks = np.asarray(outputs["instances"].pred_masks.to("cpu"))
|
131 |
+
# bbox = np.asarray(outputs["instances"].pred_boxes.to("cpu"))
|
132 |
|
133 |
# Pick an item to mask
|
134 |
# img=v.get_image()
|
|
|
137 |
measurements = {}
|
138 |
|
139 |
for ind,item_mask in enumerate(masks):
|
140 |
+
# box=bbox[ind]
|
141 |
# Get the true bounding box of the mask (not the same as the bbox prediction)
|
142 |
segmentation = np.where(item_mask == True)
|
143 |
x_min = int(np.min(segmentation[1]))
|