Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -209,14 +209,14 @@ def generate_textual_description(box_info):
|
|
| 209 |
kept_zero_boxes.sort(key = lambda x: x[0])
|
| 210 |
kept_one_boxes.sort(key = lambda x: x[0])
|
| 211 |
textual_description = "" #final output
|
| 212 |
-
textual_description += "The key elements are interpreted via visual translator. Their coordinates are represented as outlined boxes (top-left, bottom-right)"
|
| 213 |
#print(f"The key elements are interpreted via visual translator. Their coordinates are represented as outlined boxes (top-left, bottom-right)")
|
| 214 |
if len(kept_zero_boxes) >= 1:
|
| 215 |
left_most_zero_cor = kept_zero_boxes[0]
|
| 216 |
-
textual_description += f"
|
| 217 |
if len(kept_one_boxes) >= 1:
|
| 218 |
right_most_one_cor = kept_one_boxes[-1]
|
| 219 |
-
textual_description += f"
|
| 220 |
present_classes = ['fraction', 'tick']
|
| 221 |
for cid, boxes in class_summary.items():
|
| 222 |
class_name = cid
|
|
|
|
| 209 |
kept_zero_boxes.sort(key = lambda x: x[0])
|
| 210 |
kept_one_boxes.sort(key = lambda x: x[0])
|
| 211 |
textual_description = "" #final output
|
| 212 |
+
textual_description += "The key elements are interpreted via visual translator. Their coordinates are represented as outlined boxes (top-left, bottom-right). "
|
| 213 |
#print(f"The key elements are interpreted via visual translator. Their coordinates are represented as outlined boxes (top-left, bottom-right)")
|
| 214 |
if len(kept_zero_boxes) >= 1:
|
| 215 |
left_most_zero_cor = kept_zero_boxes[0]
|
| 216 |
+
textual_description += f"\nThere is a zero on the left side of the number line. Its coordinate is (({left_most_zero_cor[0]:.2f}, {left_most_zero_cor[1]:.2f}), ({left_most_zero_cor[2]:.2f}, {left_most_zero_cor[3]:.2f}))"
|
| 217 |
if len(kept_one_boxes) >= 1:
|
| 218 |
right_most_one_cor = kept_one_boxes[-1]
|
| 219 |
+
textual_description += f"\nThere is a one on the right side of the number line. Its coordinate is (({right_most_one_cor[0]:.2f}, {right_most_one_cor[1]:.2f}), ({right_most_one_cor[2]:.2f}, {right_most_one_cor[3]:.2f}))"
|
| 220 |
present_classes = ['fraction', 'tick']
|
| 221 |
for cid, boxes in class_summary.items():
|
| 222 |
class_name = cid
|