Martin Tomov commited on
Commit
2131407
1 Parent(s): a9448c9

keycv2 fix

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -91,7 +91,7 @@ def mask_to_polygon(mask: np.ndarray) -> np.ndarray:
91
  contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
92
  if len(contours) == 0:
93
  return np.array([])
94
- largest_contour = max(contours, keycv2.contourArea)
95
  return largest_contour
96
 
97
  def refine_masks(masks: torch.BoolTensor, polygon_refinement: bool = False) -> List[np.ndarray]:
 
91
  contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
92
  if len(contours) == 0:
93
  return np.array([])
94
+ largest_contour = max(contours, key=cv2.contourArea)
95
  return largest_contour
96
 
97
  def refine_masks(masks: torch.BoolTensor, polygon_refinement: bool = False) -> List[np.ndarray]: