Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -148,11 +148,11 @@ def process_image(image):
|
|
| 148 |
draw = ImageDraw.Draw(image)
|
| 149 |
font = ImageFont.load_default()
|
| 150 |
|
| 151 |
-
def iob_to_label(
|
| 152 |
-
|
| 153 |
-
if not
|
| 154 |
return 'other'
|
| 155 |
-
return
|
| 156 |
|
| 157 |
label2color = {'question':'blue', 'answer':'green', 'header':'orange', 'other':'violet'}
|
| 158 |
for prediction, box in zip(true_predictions, true_boxes):
|
|
|
|
| 148 |
draw = ImageDraw.Draw(image)
|
| 149 |
font = ImageFont.load_default()
|
| 150 |
|
| 151 |
+
def iob_to_label(labels):
|
| 152 |
+
labels= labels[2:]
|
| 153 |
+
if not labels:
|
| 154 |
return 'other'
|
| 155 |
+
return labels
|
| 156 |
|
| 157 |
label2color = {'question':'blue', 'answer':'green', 'header':'orange', 'other':'violet'}
|
| 158 |
for prediction, box in zip(true_predictions, true_boxes):
|