Spaces:
Sleeping
Sleeping
Fix: Remove 'License Plate' text from OCR results
Browse files
app.py
CHANGED
|
@@ -58,6 +58,11 @@ def predict_plate(img):
|
|
| 58 |
for obox in ocr_results[0].boxes:
|
| 59 |
cid = int(obox.cls)
|
| 60 |
ename = ocr_results[0].names[cid]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
achr = arabic_mapping.get(ename, ename)
|
| 62 |
ox1, _, ox2, _ = obox.xyxy[0]
|
| 63 |
detections.append(((ox1 + ox2) / 2, achr))
|
|
|
|
| 58 |
for obox in ocr_results[0].boxes:
|
| 59 |
cid = int(obox.cls)
|
| 60 |
ename = ocr_results[0].names[cid]
|
| 61 |
+
|
| 62 |
+
# Ignore 'License Plate' label
|
| 63 |
+
if ename.lower() == "license plate":
|
| 64 |
+
continue
|
| 65 |
+
|
| 66 |
achr = arabic_mapping.get(ename, ename)
|
| 67 |
ox1, _, ox2, _ = obox.xyxy[0]
|
| 68 |
detections.append(((ox1 + ox2) / 2, achr))
|