napatswift commited on
Commit
ca40c0f
·
1 Parent(s): d751900

Filter predictions

Browse files
Files changed (1) hide show
  1. main.py +4 -0
main.py CHANGED
@@ -89,6 +89,10 @@ def predict(image_input):
89
 
90
  # Get the masks of the tables.
91
  mask_images = result.pred_instances.masks.cpu().numpy()
 
 
 
 
92
 
93
  # For each mask, get the bounding box.
94
  for mask in mask_images:
 
89
 
90
  # Get the masks of the tables.
91
  mask_images = result.pred_instances.masks.cpu().numpy()
92
+ scores = result.pred_instances.scores.cpu().numpy()
93
+
94
+ # Filter out masks with low scores.
95
+ mask_images = mask_images[scores > 0.5]
96
 
97
  # For each mask, get the bounding box.
98
  for mask in mask_images: