You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The adet/utils/visualizer.py text decoding method _ctc_decode_recognition() includes the following code:
c = int(c)
if c < self.voc_size - 1:
if last_char != c:
if self.voc_size == 37 or self.voc_size == 96:
s += self.CTLABELS[c]
last_char = c
else:
s += str(chr(self.CTLABELS[c]))
last_char = c
This seems to assume that a custom character dictionary is a list containing Unicode ordinals of characters, as opposed to the characters themselves, as in the builtin dictionaries (from adet.utils.visualizer.TextVisualizer.__init__()):
if self.voc_size == 96:
self.CTLABELS = [' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~']
elif self.voc_size == 37:
self.CTLABELS = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9']
else:
with open(self.use_customer_dictionary, 'rb') as fp:
self.CTLABELS = pickle.load(fp)
Trying to use a list of characters results in:
TypeError: 'str' object cannot be interpreted as an integer
Not sure if this was intended to be this way or was just an oversight.
The text was updated successfully, but these errors were encountered:
The
adet/utils/visualizer.py
text decoding method_ctc_decode_recognition()
includes the following code:This seems to assume that a custom character dictionary is a list containing Unicode ordinals of characters, as opposed to the characters themselves, as in the builtin dictionaries (from
adet.utils.visualizer.TextVisualizer.__init__()
):Trying to use a list of characters results in:
Not sure if this was intended to be this way or was just an oversight.
The text was updated successfully, but these errors were encountered: