napatswift commited on
Commit
567c46b
·
1 Parent(s): f797eb8

Update weights and app

Browse files
Files changed (2) hide show
  1. main.py +6 -5
  2. model/table-det/model.pth +2 -2
main.py CHANGED
@@ -94,12 +94,13 @@ def predict(image_input):
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:
99
- bbox_list.extend(get_bbox(mask.astype(np.uint8)))
100
 
101
- # Return the bounding boxes.
102
- return bbox_list
 
 
103
 
104
 
105
  def run():
 
94
  # Filter out masks with low scores.
95
  mask_images = mask_images[scores > 0.5]
96
 
97
+ if len(mask_images) == 0:
98
+ return []
 
99
 
100
+ # Merge the masks into one mask.
101
+ mask_image = np.sum(mask_images, axis=0)
102
+
103
+ return get_bbox(mask_image.astype(np.uint8))
104
 
105
 
106
  def run():
model/table-det/model.pth CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4ed1343dc35386eda4f64af2f67413ef8b15455fc55c753b6222c7d5287b90cf
3
- size 351614497
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff4f4b8809fb9c886e96cc539cae6517fbdc289406d8b3649918d3fa497c6286
3
+ size 352081121