Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -114,6 +114,8 @@ def inference(
|
|
114 |
elapse = f"- `det cost`: {det_cost:.5f}\n - `cls cost`: {cls_cost:.5f}\n - `rec cost`: {rec_cost:.5f}"
|
115 |
dt_boxes, rec_res, scores = list(zip(*ocr_result))
|
116 |
font_path = Path("fonts") / font_dict.get(lan_name)
|
|
|
|
|
117 |
vis_img = visualize(
|
118 |
Image.fromarray(img), dt_boxes, rec_res, scores, font_path=str(font_path)
|
119 |
)
|
|
|
114 |
elapse = f"- `det cost`: {det_cost:.5f}\n - `cls cost`: {cls_cost:.5f}\n - `rec cost`: {rec_cost:.5f}"
|
115 |
dt_boxes, rec_res, scores = list(zip(*ocr_result))
|
116 |
font_path = Path("fonts") / font_dict.get(lan_name)
|
117 |
+
|
118 |
+
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
119 |
vis_img = visualize(
|
120 |
Image.fromarray(img), dt_boxes, rec_res, scores, font_path=str(font_path)
|
121 |
)
|