@@ -75,6 +75,7 @@ def __init__(self, filePath, batchSize, imgSize, maxTextLen, load_aug=True):
75
75
lineSplit [0 ] + '.png'
76
76
77
77
# GT text are columns starting at 10
78
+ # see the lines.txt and check where the GT text starts, in this case it is 10
78
79
gtText_list = lineSplit [9 ].split ('|' )
79
80
gtText = self .truncateLabel (' ' .join (gtText_list ), maxTextLen )
80
81
chars = chars .union (set (list (gtText ))) ## taking the unique characters present
@@ -93,7 +94,7 @@ def __init__(self, filePath, batchSize, imgSize, maxTextLen, load_aug=True):
93
94
print ("Warning, damaged images found:" , bad_samples )
94
95
print ("Damaged images expected:" , bad_samples_reference )
95
96
96
- # split into training and validation set: 90 % - 10%
97
+ # split into training and validation set: 95 % - 10%
97
98
splitIdx = int (0.95 * len (self .samples ))
98
99
self .trainSamples = self .samples [:splitIdx ]
99
100
self .validationSamples = self .samples [splitIdx :]
@@ -130,7 +131,7 @@ def trainSet(self):
130
131
"switch to randomly chosen subset of training set"
131
132
self .dataAugmentation = True
132
133
self .currIdx = 0
133
- # random.shuffle(self.trainSamples)
134
+ random .shuffle (self .trainSamples ) # shuffle the samples in each epoch
134
135
self .samples = self .trainSamples #[:self.numTrainSamplesPerEpoch]
135
136
136
137
def validationSet (self ):
0 commit comments