Skip to content

Commit

Permalink
Fixes single instance model visualization during training (talmolab#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
talmo authored Dec 29, 2021
1 parent 507b71a commit c75e143
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sleap/nn/data/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,14 @@ def make_viz_pipeline(
A `Pipeline` instance configured to fetch data and run inference to generate
predictions useful for visualization during training.
"""
pipeline = self.make_base_pipeline(data_provider=data_provider)
pipeline += Prefetcher()
pipeline = Pipeline(providers=data_provider)
if self.data_config.preprocessing.resize_and_pad_to_target:
pipeline += SizeMatcher.from_config(
config=self.data_config.preprocessing,
provider=data_provider,
)
pipeline += Repeater()
pipeline += Prefetcher()
return pipeline


Expand Down
1 change: 1 addition & 0 deletions sleap/nn/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ def _setup_visualization(self):
inference_layer = SingleInstanceInferenceLayer(
keras_model=self.keras_model,
input_scale=self.config.data.preprocessing.input_scaling,
pad_to_stride=self.config.data.preprocessing.pad_to_stride,
peak_threshold=0.2,
return_confmaps=True,
)
Expand Down

0 comments on commit c75e143

Please sign in to comment.