Spaces:
Sleeping
Sleeping
Update tasks/image.py
Browse files- tasks/image.py +1 -1
tasks/image.py
CHANGED
@@ -178,7 +178,7 @@ async def evaluate_image(request: ImageEvaluationRequest):
|
|
178 |
# Threshold and process the segmentation mask
|
179 |
probabilities = torch.sigmoid(logits)
|
180 |
predicted_mask = (probabilities[0, 1] > 0.30).cpu().numpy().astype(np.uint8)
|
181 |
-
predicted_mask_resized = cv2.resize(predicted_mask,
|
182 |
|
183 |
# Extract bounding boxes
|
184 |
predicted_boxes = get_bounding_boxes_from_mask(predicted_mask_resized)
|
|
|
178 |
# Threshold and process the segmentation mask
|
179 |
probabilities = torch.sigmoid(logits)
|
180 |
predicted_mask = (probabilities[0, 1] > 0.30).cpu().numpy().astype(np.uint8)
|
181 |
+
predicted_mask_resized = cv2.resize(predicted_mask, (512,512), interpolation=cv2.INTER_NEAREST)
|
182 |
|
183 |
# Extract bounding boxes
|
184 |
predicted_boxes = get_bounding_boxes_from_mask(predicted_mask_resized)
|