Spaces:
Build error
Build error
Fix bugs + minor changes
Browse files
app.py
CHANGED
|
@@ -188,7 +188,7 @@ def visualize_ocr(pil_img, ocr_result):
|
|
| 188 |
y1 = int(bbox[1])
|
| 189 |
x2 = int(bbox[2])
|
| 190 |
y2 = int(bbox[3])
|
| 191 |
-
cv2.rectangle(image, (x1, y1), (x2, y2), color=(0,
|
| 192 |
cv2.putText(image, res['text'], (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, fontScale=0.25, color=(255, 0, 0))
|
| 193 |
return cv_to_PIL(image)
|
| 194 |
|
|
@@ -273,7 +273,7 @@ def visualize_structure(pil_img, structure_result):
|
|
| 273 |
)
|
| 274 |
|
| 275 |
plt.legend(handles=legend_elements, bbox_to_anchor=(0.5, -0.02), loc='upper center', borderaxespad=0,
|
| 276 |
-
fontsize=10, ncol=
|
| 277 |
plt.gcf().set_size_inches(10, 10)
|
| 278 |
plt.axis('off')
|
| 279 |
img_buf = io.BytesIO()
|
|
|
|
| 188 |
y1 = int(bbox[1])
|
| 189 |
x2 = int(bbox[2])
|
| 190 |
y2 = int(bbox[3])
|
| 191 |
+
cv2.rectangle(image, (x1, y1), (x2, y2), color=(0, 0, 255))
|
| 192 |
cv2.putText(image, res['text'], (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, fontScale=0.25, color=(255, 0, 0))
|
| 193 |
return cv_to_PIL(image)
|
| 194 |
|
|
|
|
| 273 |
)
|
| 274 |
|
| 275 |
plt.legend(handles=legend_elements, bbox_to_anchor=(0.5, -0.02), loc='upper center', borderaxespad=0,
|
| 276 |
+
fontsize=10, ncol=6)
|
| 277 |
plt.gcf().set_size_inches(10, 10)
|
| 278 |
plt.axis('off')
|
| 279 |
img_buf = io.BytesIO()
|