Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VisualPredictor class #2048

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix for bottom-up models
roomrys committed Dec 16, 2024
commit c3b12f5e59bbce74a8475f69f6317c25255b5606
7 changes: 7 additions & 0 deletions sleap/nn/inference.py
Original file line number Diff line number Diff line change
@@ -611,6 +611,13 @@ def from_trained_models(cls, model_path: Text) -> "VisualPredictor":

return cls(config=cfg, model=model)

def _initialize_inference_model(self):
"""Initialize the inference model from the trained model and configuration."""
pass

def is_grayscale(self) -> bool:
return self.model.keras_model.input.shape[-1] == 1

def head_specific_output_keys(self) -> List[Text]:
keys = []

2 changes: 2 additions & 0 deletions tests/nn/test_inference.py
Original file line number Diff line number Diff line change
@@ -2078,5 +2078,7 @@ def test_top_down_model(min_tracks_2node_labels: Labels, min_centroid_model_path


def test_visual_predictor(min_bottomup_model_path):

# Test bottom-up model
model_path: str = min_bottomup_model_path
predictor = VisualPredictor.from_trained_models(model_path=model_path)