Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,8 +139,8 @@ def recognize_table(image):
|
|
| 139 |
outputs = structure_model(pixel_values)
|
| 140 |
|
| 141 |
# postprocess to get individual elements
|
| 142 |
-
id2label =
|
| 143 |
-
id2label[len(
|
| 144 |
detected_tables = outputs_to_objects(outputs, image.size, id2label)
|
| 145 |
|
| 146 |
# visualize cells on cropped table
|
|
|
|
| 139 |
outputs = structure_model(pixel_values)
|
| 140 |
|
| 141 |
# postprocess to get individual elements
|
| 142 |
+
id2label = structure_model.config.id2label
|
| 143 |
+
id2label[len(structure_model.config.id2label)] = "no object"
|
| 144 |
detected_tables = outputs_to_objects(outputs, image.size, id2label)
|
| 145 |
|
| 146 |
# visualize cells on cropped table
|