handsme commited on
Commit ·
57d81fa
1
Parent(s): 3ac77d5
修复 RapidOCR 解析格式错误
Browse files
app.py
CHANGED
|
@@ -41,10 +41,10 @@ def ocr_recognize(image):
|
|
| 41 |
|
| 42 |
if result:
|
| 43 |
for item in result:
|
| 44 |
-
# RapidOCR 返回格式: (bbox,
|
| 45 |
bbox = item[0] # [[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
|
| 46 |
-
text = item[1]
|
| 47 |
-
confidence = item[
|
| 48 |
|
| 49 |
lines.append(text)
|
| 50 |
raw_results.append({
|
|
|
|
| 41 |
|
| 42 |
if result:
|
| 43 |
for item in result:
|
| 44 |
+
# RapidOCR 返回格式: (bbox, text, confidence)
|
| 45 |
bbox = item[0] # [[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
|
| 46 |
+
text = item[1]
|
| 47 |
+
confidence = item[2]
|
| 48 |
|
| 49 |
lines.append(text)
|
| 50 |
raw_results.append({
|