--data_filtering_off

This commit is contained in:
Baek JeongHun 2019-07-16 10:04:20 +00:00
parent c3e07b538a
commit dd18436360
3 changed files with 6 additions and 6 deletions

View File

@ -123,7 +123,10 @@ class LmdbDataset(Dataset):
nSamples = int(txn.get('num-samples'.encode()))
self.nSamples = nSamples
if self.opt.data_filtering:
if self.opt.data_filtering_off:
# for fast check with no filtering
self.filtered_index_list = [index + 1 for index in range(self.nSamples)]
else:
# Filtering
self.filtered_index_list = []
for index in range(self.nSamples):
@ -139,9 +142,6 @@ class LmdbDataset(Dataset):
self.filtered_index_list.append(index)
self.nSamples = len(self.filtered_index_list)
else:
# for fast check with no filtering
self.filtered_index_list = [index+1 for index in range(self.nSamples)]
def __len__(self):
return self.nSamples

View File

@ -203,7 +203,7 @@ if __name__ == '__main__':
parser.add_argument('--character', type=str, default='0123456789abcdefghijklmnopqrstuvwxyz', help='character label')
parser.add_argument('--sensitive', action='store_true', help='for sensitive character mode')
parser.add_argument('--PAD', action='store_true', help='whether to keep ratio then pad for image resize')
parser.add_argument('--data_filtering', default=True, help='for data_filtering mode')
parser.add_argument('--data_filtering_off', action='store_true', help='for data_filtering_off mode')
""" Model Architecture """
parser.add_argument('--Transformation', type=str, required=True, help='Transformation stage. None|TPS')
parser.add_argument('--FeatureExtraction', type=str, required=True, help='FeatureExtraction stage. VGG|RCNN|ResNet')

View File

@ -225,7 +225,7 @@ if __name__ == '__main__':
parser.add_argument('--character', type=str, default='0123456789abcdefghijklmnopqrstuvwxyz', help='character label')
parser.add_argument('--sensitive', action='store_true', help='for sensitive character mode')
parser.add_argument('--PAD', action='store_true', help='whether to keep ratio then pad for image resize')
parser.add_argument('--data_filtering', default=True, help='for data_filtering mode')
parser.add_argument('--data_filtering_off', action='store_true', help='for data_filtering_off mode')
""" Model Architecture """
parser.add_argument('--Transformation', type=str, required=True, help='Transformation stage. None|TPS')
parser.add_argument('--FeatureExtraction', type=str, required=True, help='FeatureExtraction stage. VGG|RCNN|ResNet')