From dd184363606e3ebcf05a5f88b2fc7977b3298bda Mon Sep 17 00:00:00 2001 From: Baek JeongHun Date: Tue, 16 Jul 2019 10:04:20 +0000 Subject: [PATCH] --data_filtering_off --- dataset.py | 8 ++++---- test.py | 2 +- train.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dataset.py b/dataset.py index 62290db..b5d7468 100755 --- a/dataset.py +++ b/dataset.py @@ -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 diff --git a/test.py b/test.py index 58716b6..ba1d269 100755 --- a/test.py +++ b/test.py @@ -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') diff --git a/train.py b/train.py index 7a48b9f..284ebf8 100755 --- a/train.py +++ b/train.py @@ -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')