Skip to content

Commit

Permalink
order
Browse files Browse the repository at this point in the history
  • Loading branch information
arie-matsliah committed Feb 2, 2021
1 parent 5de0b1b commit ad55f9f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions sleap/nn/data/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ad55f9f

Please sign in to comment.