Skip to content

Commit

Permalink
Add bounding box lens to Python layout
Browse files Browse the repository at this point in the history
  • Loading branch information
druzsan committed Feb 20, 2024
1 parent 6c9c954 commit 14656ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions renumics/spotlight/layout/lenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ def image(column: str, name: Optional[str] = None) -> Lens:
return Lens(type="ImageView", columns=[column], name=name)


def bounding_box(
column: str,
bounding_box_column: str,
category_column: Optional[str] = None,
name: Optional[str] = None,
) -> Lens:
"""
Add audio viewer to Spotlight inspector widget.
Supports a single column of type `spotlight.Audio` with optional second
column of type `spotlight.Window`.
"""
columns = [column, bounding_box_column]
if category_column is not None:
columns.append(category_column)
return Lens(type="BoundingBoxView", columns=columns, name=name)


def video(column: str, name: Optional[str] = None) -> Lens:
"""
Add video viewer to Spotlight inspector widget.
Expand Down

0 comments on commit 14656ee

Please sign in to comment.