Spaces:
Runtime error
Runtime error
napatswift
commited on
Commit
·
567c46b
1
Parent(s):
f797eb8
Update weights and app
Browse files- main.py +6 -5
- 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 |
-
|
98 |
-
|
99 |
-
bbox_list.extend(get_bbox(mask.astype(np.uint8)))
|
100 |
|
101 |
-
#
|
102 |
-
|
|
|
|
|
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:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff4f4b8809fb9c886e96cc539cae6517fbdc289406d8b3649918d3fa497c6286
|
3 |
+
size 352081121
|