Skip to content

Commit

Permalink
fix(embeddings): hover on original image highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Jul 31, 2024
1 parent e11b422 commit 0b7d00b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/nrtk_explorer/app/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def on_move(self, camera_position):
def set_on_hover(self, fn):
self._on_hover_fn = fn

def on_hover(self, point_index):
def on_point_hover(self, point_index):
self.state.highlighted_point = point_index
image_id = ""
if point_index is not None:
Expand Down Expand Up @@ -231,7 +231,7 @@ def visualization_widget(self):
cameraMove="camera_position=$event",
cameraPosition=("camera_position",),
highlightedPoint=("highlighted_point", -1),
hover=(self.on_hover, "[$event]"),
hover=(self.on_point_hover, "[$event]"),
points=("points_sources", []),
transformedPoints=("points_transformations", []),
select=(self.on_select, "[$event]"),
Expand Down
11 changes: 6 additions & 5 deletions src/nrtk_explorer/app/ui/image_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def __init__(self, hover_fn=None, **kwargs):
ground_truth_to_transformed_detection_score: meta.ground_truth_to_transformed_detection_score.toFixed(2),
original_detection_to_transformed_detection_score: meta.original_detection_to_transformed_detection_score.toFixed(2),
id: datasetId,
original: `original-image/${datasetId}`,
original: id,
original_src: `original-image/${datasetId}`,
transformed: `transformed_${id}`,
groundTruthAnnotations: get(`result_${datasetId}`),
originalAnnotations: get(`result_${id}`),
Expand All @@ -102,7 +103,7 @@ def __init__(self, hover_fn=None, **kwargs):
ImageDetection(
style="max-width: 10rem; float: inline-end;",
identifier=("props.row.original",),
src=("props.row.original",),
src=("props.row.original_src",),
annotations=("props.row.groundTruthAnnotations",),
categories=("annotation_categories",),
selected=("(props.row.original == hovered_id)",),
Expand All @@ -119,7 +120,7 @@ def __init__(self, hover_fn=None, **kwargs):
ImageDetection(
style="max-width: 10rem; float: inline-end;",
identifier=("props.row.original",),
src=("props.row.original",),
src=("props.row.original_src",),
annotations=("props.row.originalAnnotations",),
categories=("annotation_categories",),
selected=("(props.row.original == hovered_id)",),
Expand Down Expand Up @@ -164,7 +165,7 @@ def __init__(self, hover_fn=None, **kwargs):
)
ImageDetection(
identifier=("props.row.original",),
src=("props.row.original",),
src=("props.row.original_src",),
annotations=("props.row.groundTruthAnnotations",),
categories=("annotation_categories",),
selected=("(props.row.original == hovered_id)",),
Expand All @@ -183,7 +184,7 @@ def __init__(self, hover_fn=None, **kwargs):
)
ImageDetection(
identifier=("props.row.original",),
src=("props.row.original",),
src=("props.row.original_src",),
annotations=("props.row.originalAnnotations",),
categories=("annotation_categories",),
selected=("(props.row.original == hovered_id)",),
Expand Down

0 comments on commit 0b7d00b

Please sign in to comment.