Update src/utils.py
Browse files- src/utils.py +1 -1
src/utils.py
CHANGED
@@ -156,7 +156,7 @@ def draw_ocr_bboxes(image, prediction):
|
|
156 |
|
157 |
# Calculate the position for the text label
|
158 |
text_x, text_y = min(new_box[0::2]), min(new_box[1::2]) - 20
|
159 |
-
text_w, text_h = draw.
|
160 |
rgba_color = hex_to_rgba(color, 200) # Semi-transparent background for text
|
161 |
|
162 |
# Draw the background rectangle for the text
|
|
|
156 |
|
157 |
# Calculate the position for the text label
|
158 |
text_x, text_y = min(new_box[0::2]), min(new_box[1::2]) - 20
|
159 |
+
text_w, text_h = draw.textsize(label)
|
160 |
rgba_color = hex_to_rgba(color, 200) # Semi-transparent background for text
|
161 |
|
162 |
# Draw the background rectangle for the text
|