From ad55f9feb9fa14399d339f44109c91e54f6ebb36 Mon Sep 17 00:00:00 2001 From: Arie Matsliah Date: Tue, 2 Feb 2021 09:56:20 -0800 Subject: [PATCH] order --- sleap/nn/data/pipelines.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sleap/nn/data/pipelines.py b/sleap/nn/data/pipelines.py index 050820a83..ee6636389 100644 --- a/sleap/nn/data/pipelines.py +++ b/sleap/nn/data/pipelines.py @@ -353,12 +353,12 @@ def make_base_pipeline(self, data_provider: Provider) -> Pipeline: """ pipeline = Pipeline(providers=data_provider) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) + pipeline += Resizer.from_config(self.data_config.preprocessing) if self.optimization_config.augmentation_config.random_crop: pipeline += RandomCropper( crop_height=self.optimization_config.augmentation_config.random_crop_height, @@ -398,13 +398,12 @@ def make_training_pipeline(self, data_provider: Provider) -> Pipeline: crop_width=self.optimization_config.augmentation_config.random_crop_width, ) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) - + pipeline += Resizer.from_config(self.data_config.preprocessing) pipeline += SingleInstanceConfidenceMapGenerator( sigma=self.single_instance_confmap_head.sigma, output_stride=self.single_instance_confmap_head.output_stride, @@ -493,12 +492,12 @@ def make_base_pipeline(self, data_provider: Provider) -> Pipeline: """ pipeline = Pipeline(providers=data_provider) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) + pipeline += Resizer.from_config(self.data_config.preprocessing) if self.optimization_config.augmentation_config.random_crop: pipeline += RandomCropper( crop_height=self.optimization_config.augmentation_config.random_crop_height, @@ -544,13 +543,12 @@ def make_training_pipeline(self, data_provider: Provider) -> Pipeline: crop_width=self.optimization_config.augmentation_config.random_crop_width, ) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) - + pipeline += Resizer.from_config(self.data_config.preprocessing) pipeline += InstanceCentroidFinder.from_config( self.data_config.instance_cropping, skeletons=self.data_config.labels.skeletons, @@ -655,12 +653,12 @@ def make_base_pipeline(self, data_provider: Provider) -> Pipeline: """ pipeline = Pipeline(providers=data_provider) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) + pipeline += Resizer.from_config(self.data_config.preprocessing) pipeline += InstanceCentroidFinder.from_config( self.data_config.instance_cropping, skeletons=self.data_config.labels.skeletons, @@ -697,13 +695,12 @@ def make_training_pipeline(self, data_provider: Provider) -> Pipeline: self.optimization_config.augmentation_config ) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) - + pipeline += Resizer.from_config(self.data_config.preprocessing) pipeline += InstanceCentroidFinder.from_config( self.data_config.instance_cropping, skeletons=self.data_config.labels.skeletons, @@ -794,12 +791,12 @@ def make_base_pipeline(self, data_provider: Provider) -> Pipeline: """ pipeline = Pipeline(providers=data_provider) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) + pipeline += Resizer.from_config(self.data_config.preprocessing) if self.optimization_config.augmentation_config.random_crop: pipeline += RandomCropper( crop_height=self.optimization_config.augmentation_config.random_crop_height, @@ -840,13 +837,12 @@ def make_training_pipeline(self, data_provider: Provider) -> Pipeline: crop_width=aug_config.random_crop_width, ) pipeline += Normalizer.from_config(self.data_config.preprocessing) - pipeline += Resizer.from_config(self.data_config.preprocessing) if self.data_config.preprocessing.resize_and_pad_to_target: pipeline += SizeMatcher.from_config( config=self.data_config.preprocessing, provider=data_provider, ) - + pipeline += Resizer.from_config(self.data_config.preprocessing) pipeline += MultiConfidenceMapGenerator( sigma=self.confmaps_head.sigma, output_stride=self.confmaps_head.output_stride,