Spaces:
Runtime error
Runtime error
NassimeBejaia
commited on
Commit
•
0328c09
1
Parent(s):
5555b23
Rename Utils(2).py to Utils.py
Browse files- Utils(2).py → Utils.py +0 -14
Utils(2).py → Utils.py
RENAMED
@@ -21,10 +21,6 @@ alpha =['A', 'A1', 'A2' ,'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L','
|
|
21 |
|
22 |
############ decode_detection ################
|
23 |
|
24 |
-
# labels from KHATT dataset
|
25 |
-
"""characters = [' ', '!', '"', '#', '%', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '=', '>', '?', '[', '\\', ']', 'x', '\xa0', '×', '،', '؛', '؟', 'ء', 'آ', 'أ', 'ؤ', 'إ', 'ئ', 'ا', 'ب', 'ة', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ـ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ى', 'ي', 'ً', 'ٌ', 'ٍ', 'َ', 'ُ', 'ِ', 'ّ', 'ْ', '–', '‘']
|
26 |
-
characters.sort()"""
|
27 |
-
|
28 |
|
29 |
# labels from old arabic
|
30 |
characters = [' ', '.', '[', ']', '؟', 'ء', 'آ', 'أ', 'ؤ', 'إ', 'ئ', 'ا', 'ب', 'ة', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ـ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ى', 'ي', 'ً', 'ٌ', 'ٍ', 'َ', 'ُ', 'ِ', 'ّ', 'ْ', 'ٔ', 'ٕ', '١', '٢', '٣', '٤', '٥', '٧', '٨', 'ٮ', 'ٯ', 'ٰ', 'ڡ', 'ک', 'ں', 'ی', '۴', '\u202c', 'ﭐ', 'ﺟ', 'ﺣ', 'ﻛ', '�']
|
@@ -78,16 +74,6 @@ def decode_predictions(pred,greedy = True):
|
|
78 |
|
79 |
|
80 |
|
81 |
-
# def encode_single_sample(path_dir,label = None):
|
82 |
-
# img = tf.io.read_file(path_dir)
|
83 |
-
# img = tf.io.decode_jpeg( img, name=None)
|
84 |
-
# img.set_shape([img.shape[0], img.shape[1],img.shape[-1]])
|
85 |
-
# img = tf.image.rot90(img, k=1, name=None)
|
86 |
-
# img = tf.image.resize(img, [img_height, img_width])
|
87 |
-
# img=img/255.0
|
88 |
-
# #img=tf.concat([img,img,img],axis=-1)
|
89 |
-
|
90 |
-
# return img
|
91 |
|
92 |
def encode_single_sample(path_dir, label=None):
|
93 |
img = tf.io.read_file(path_dir)
|
|
|
21 |
|
22 |
############ decode_detection ################
|
23 |
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# labels from old arabic
|
26 |
characters = [' ', '.', '[', ']', '؟', 'ء', 'آ', 'أ', 'ؤ', 'إ', 'ئ', 'ا', 'ب', 'ة', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ـ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ى', 'ي', 'ً', 'ٌ', 'ٍ', 'َ', 'ُ', 'ِ', 'ّ', 'ْ', 'ٔ', 'ٕ', '١', '٢', '٣', '٤', '٥', '٧', '٨', 'ٮ', 'ٯ', 'ٰ', 'ڡ', 'ک', 'ں', 'ی', '۴', '\u202c', 'ﭐ', 'ﺟ', 'ﺣ', 'ﻛ', '�']
|
|
|
74 |
|
75 |
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
def encode_single_sample(path_dir, label=None):
|
79 |
img = tf.io.read_file(path_dir)
|