Update app.py
Browse files
app.py
CHANGED
|
@@ -4,19 +4,51 @@ from huggingface_hub import snapshot_download
|
|
| 4 |
from PIL import Image, ImageDraw, ImageFont
|
| 5 |
import cv2
|
| 6 |
import numpy as np
|
| 7 |
-
|
| 8 |
-
# Mapping dictionary
|
| 9 |
hoppa = {
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# Model path
|
| 19 |
-
model_dir = snapshot_download("omarelsayeed/licence_plates") + "/
|
| 20 |
# YOLO model initialization
|
| 21 |
model = YOLO(model_dir)
|
| 22 |
|
|
|
|
| 4 |
from PIL import Image, ImageDraw, ImageFont
|
| 5 |
import cv2
|
| 6 |
import numpy as np
|
|
|
|
|
|
|
| 7 |
hoppa = {
|
| 8 |
+
"0": "٠",
|
| 9 |
+
"1": "١",
|
| 10 |
+
"2": "٢",
|
| 11 |
+
"3": "٣",
|
| 12 |
+
"4": "٤",
|
| 13 |
+
"5": "٥",
|
| 14 |
+
"6": "٦",
|
| 15 |
+
"7": "٧",
|
| 16 |
+
"8":"٨",
|
| 17 |
+
"9":"٩",
|
| 18 |
+
"Beh": "ب",
|
| 19 |
+
"Daad": "ض",
|
| 20 |
+
"Een": "ع",
|
| 21 |
+
"F": "ف",
|
| 22 |
+
"Heeh": "هه",
|
| 23 |
+
"Kaaf": "ك",
|
| 24 |
+
"Laam": "ل",
|
| 25 |
+
"License Plate": "",
|
| 26 |
+
"Meem": "م",
|
| 27 |
+
"Noon": "ن",
|
| 28 |
+
"Q": "ق",
|
| 29 |
+
"R": "ر",
|
| 30 |
+
"Saad": "ص",
|
| 31 |
+
"Seen": "س",
|
| 32 |
+
"Taa": "ط",
|
| 33 |
+
"Wow": "و",
|
| 34 |
+
"Yeeh": "ي",
|
| 35 |
+
"Zah": "ظ",
|
| 36 |
+
"Zeen": "ز",
|
| 37 |
+
"alef": "أ",
|
| 38 |
+
"car": "",
|
| 39 |
+
"daal": "د",
|
| 40 |
+
"geem": "ج",
|
| 41 |
+
"ghayn": "غ",
|
| 42 |
+
"khaa": "خ",
|
| 43 |
+
"sheen": "ش",
|
| 44 |
+
"teh": "ت",
|
| 45 |
+
"theh": "ث",
|
| 46 |
+
"zaal": "ذ",
|
| 47 |
+
"7aah" : "ح"
|
| 48 |
+
}
|
| 49 |
|
| 50 |
# Model path
|
| 51 |
+
model_dir = snapshot_download("omarelsayeed/licence_plates") + "/license_yolo8s_1024.pt"
|
| 52 |
# YOLO model initialization
|
| 53 |
model = YOLO(model_dir)
|
| 54 |
|