Skip to content

Commit

Permalink
refactor(embeddings): remove pointless code
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Jan 15, 2025
1 parent 6414b7d commit ae8186d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/nrtk_explorer/app/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(
if self.is_standalone_app and datasets:
self.state.dataset_ids = []
self.state.current_dataset = datasets[0]
self.on_current_dataset_change()
self.context.dataset = get_dataset(self.state.current_dataset)

self.features = None

Expand All @@ -55,10 +55,6 @@ def __init__(
}

def on_server_ready(self, *args, **kwargs):
# Bind instance methods to state change
self.on_current_dataset_change()
self.state.change("current_dataset")(self.on_current_dataset_change)

self.on_feature_extraction_model_change()
self.state.change("feature_extraction_model")(self.on_feature_extraction_model_change)

Expand All @@ -74,14 +70,6 @@ def on_feature_extraction_model_change(self, **kwargs):
model_name=feature_extraction_model
)

def on_current_dataset_change(self, **kwargs):
self.state.num_elements_disabled = True
if self.context.dataset is None:
self.context.dataset = get_dataset(self.state.current_dataset)

self.state.num_elements_max = len(list(self.context.dataset.imgs))
self.state.num_elements_disabled = False

def compute_points(self, fit_features, features):
if len(features) == 0:
# reduce will fail if no features
Expand Down Expand Up @@ -114,7 +102,7 @@ def compute_points(self, fit_features, features):
)

def clear_points_transformations(self, **kwargs):
self.state.points_transformations = {} # ID to point
self.state.points_transformations = {} # datset ID to point
self._stashed_points_transformations = {}

def update_points_transformations_state(self, **kwargs):
Expand Down

0 comments on commit ae8186d

Please sign in to comment.