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

Visualization block copy #897

Merged
merged 6 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class BoundingBoxManifest(ColorableVisualizationManifest):
)

thickness: Union[int, Selector(kind=[INTEGER_KIND])] = Field( # type: ignore
description="Thickness of the bounding box in pixels.",
description="Set the thickness of the bounding box edges.",
default=2,
examples=[2, "$inputs.thickness"],
)

roundness: Union[FloatZeroToOne, Selector(kind=[FLOAT_ZERO_TO_ONE_KIND])] = Field( # type: ignore
description="Roundness of the corners of the bounding box.",
description="Define the roundness of the bounding box corners.",
default=0.0,
examples=[0.0, "$inputs.roundness"],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ class VisualizationManifest(WorkflowBlockManifest, ABC):
)
image: Selector(kind=[IMAGE_KIND]) = Field(
title="Input Image",
description="The input image for this step.",
description="Select the input image to visualize on.",
examples=["$inputs.image", "$steps.cropping.crops"],
validation_alias=AliasChoices("image", "images"),
)
copy_image: Union[bool, Selector(kind=[BOOLEAN_KIND])] = Field( # type: ignore
description="Duplicate the image contents (vs overwriting the image in place). Deselect for chained visualizations that should stack on previous ones where the intermediate state is not needed.",
description="Enable this option to create a copy of the input image for visualization, preserving the original. Use this when stacking multiple visualizations.",
default=True,
examples=[True, False],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ColorableVisualizationManifest(PredictionsVisualizationManifest, ABC):
Selector(kind=[STRING_KIND]),
] = Field( # type: ignore
default="DEFAULT",
description="Color palette to use for annotations.",
description="Select a color palette for the bounding boxes.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this property is used for non bounding boxes (ex. polygons). would double check the wording

examples=["DEFAULT", "$inputs.color_palette"],
)

Expand All @@ -86,14 +86,14 @@ class ColorableVisualizationManifest(PredictionsVisualizationManifest, ABC):
Selector(kind=[INTEGER_KIND]),
] = Field( # type: ignore
default=10,
description="Number of colors in the color palette. Applies when using a matplotlib `color_palette`.",
description="Specify the number of colors in the palette. This applies when using custom or Matplotlib palettes.",
examples=[10, "$inputs.palette_size"],
)

custom_colors: Union[List[str], Selector(kind=[LIST_OF_VALUES_KIND])] = (
Field( # type: ignore
default=[],
description='List of colors to use for annotations when `color_palette` is set to "CUSTOM".',
description='Define a list of custom colors for bounding boxes in HEX format.',
examples=[["#FF0000", "#00FF00", "#0000FF"], "$inputs.custom_colors"],
)
)
Expand All @@ -103,7 +103,7 @@ class ColorableVisualizationManifest(PredictionsVisualizationManifest, ABC):
Selector(kind=[STRING_KIND]),
] = Field( # type: ignore
default="CLASS",
description="Strategy to use for mapping colors to annotations.",
description="Choose how bounding box colors are assigned.",
examples=["CLASS", "$inputs.color_axis"],
)

Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/prototypes/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WorkflowBlockManifest(BaseModel, ABC):
)

type: str
name: str = Field(title="Step Name", description="The unique name of this step.")
name: str = Field(title="Step Name", description="Enter a unique identifier for this step.")

@classmethod
@abstractmethod
Expand Down
Loading