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

[WIP] Clean up kinds #618

Merged
merged 7 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -12,8 +12,8 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_IMAGES_KIND,
FLOAT_KIND,
IMAGE_KIND,
StepOutputImageSelector,
WorkflowImageSelector,
)
Expand Down Expand Up @@ -57,9 +57,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
return [
OutputDefinition(
name=OUTPUT_IMAGE_KEY,
kind=[
BATCH_OF_IMAGES_KIND,
],
kind=[IMAGE_KIND],
),
OutputDefinition(
name="focus_measure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_IMAGES_KIND,
CONTOURS_KIND,
IMAGE_KIND,
INTEGER_KIND,
NUMPY_ARRAY_KIND,
StepOutputImageSelector,
Expand Down Expand Up @@ -64,7 +64,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
OutputDefinition(
name=OUTPUT_IMAGE_KEY,
kind=[
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
],
),
OutputDefinition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
StepOutputImageSelector,
WorkflowImageSelector,
)
Expand Down Expand Up @@ -53,7 +53,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
OutputDefinition(
name=OUTPUT_IMAGE_KEY,
kind=[
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
],
),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
INTEGER_KIND,
STRING_KIND,
StepOutputImageSelector,
Expand Down Expand Up @@ -73,7 +73,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
OutputDefinition(
name=OUTPUT_IMAGE_KEY,
kind=[
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
],
),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_INTEGER_KIND,
INTEGER_KIND,
RGB_COLOR_KIND,
STRING_KIND,
Expand Down Expand Up @@ -73,7 +72,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
return [
OutputDefinition(
name="matching_pixels_count",
kind=[BATCH_OF_INTEGER_KIND],
kind=[INTEGER_KIND],
),
]

Expand Down
4 changes: 2 additions & 2 deletions inference/core/workflows/core_steps/classical_cv/sift/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_IMAGES_KIND,
IMAGE_KEYPOINTS_KIND,
IMAGE_KIND,
NUMPY_ARRAY_KIND,
StepOutputImageSelector,
WorkflowImageSelector,
Expand Down Expand Up @@ -66,7 +66,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
return [
OutputDefinition(
name=OUTPUT_IMAGE_KEY,
kind=[BATCH_OF_IMAGES_KIND],
kind=[IMAGE_KIND],
),
OutputDefinition(
name="keypoints",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_INTEGER_KIND,
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BOOLEAN_KIND,
FLOAT_KIND,
FLOAT_ZERO_TO_ONE_KIND,
INTEGER_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
FloatZeroToOne,
StepOutputImageSelector,
WorkflowImageSelector,
Expand Down Expand Up @@ -110,11 +110,11 @@ def describe_outputs(cls) -> List[OutputDefinition]:
return [
OutputDefinition(
name="predictions",
kind=[BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND],
kind=[OBJECT_DETECTION_PREDICTION_KIND],
),
OutputDefinition(
name="number_of_matches",
kind=[BATCH_OF_INTEGER_KIND],
kind=[INTEGER_KIND],
),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
INTEGER_KIND,
STRING_KIND,
StepOutputImageSelector,
Expand Down Expand Up @@ -86,7 +86,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
OutputDefinition(
name=OUTPUT_IMAGE_KEY,
kind=[
BATCH_OF_IMAGES_KIND,
IMAGE_KIND,
],
),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
StatementsGroupsOperator,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_CLASSIFICATION_PREDICTION_KIND,
BOOLEAN_KIND,
CLASSIFICATION_PREDICTION_KIND,
DETECTION_KIND,
DICTIONARY_KIND,
FLOAT_KIND,
Expand Down Expand Up @@ -214,7 +214,7 @@ class ClassificationPropertyExtract(OperationDefinition):
"(as a list of elements - one element represents single detection)",
"compound": False,
"input_kind": [
BATCH_OF_CLASSIFICATION_PREDICTION_KIND,
CLASSIFICATION_PREDICTION_KIND,
],
"output_kind": [STRING_KIND, LIST_OF_VALUES_KIND, FLOAT_ZERO_TO_ONE_KIND],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
)
from inference.core.workflows.execution_engine.entities.base import OutputDefinition
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_CLASSIFICATION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
CLASSIFICATION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
StepOutputSelector,
)
from inference.core.workflows.prototypes.block import (
Expand Down Expand Up @@ -62,10 +62,10 @@ class BlockManifest(WorkflowBlockManifest):
]
data: StepOutputSelector(
kind=[
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
BATCH_OF_CLASSIFICATION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
CLASSIFICATION_PREDICTION_KIND,
]
) = Field(
description="Reference data to extract property from",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
OutputDefinition,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_CLASSIFICATION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
CLASSIFICATION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
StepOutputSelector,
)
from inference.core.workflows.prototypes.block import (
Expand Down Expand Up @@ -56,17 +56,17 @@ class BlockManifest(WorkflowBlockManifest):
]
object_detection_predictions: StepOutputSelector(
kind=[
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
]
) = Field(
title="Regions of Interest",
description="The output of a detection model describing the bounding boxes that will have classes replaced.",
examples=["$steps.my_object_detection_model.predictions"],
)
classification_predictions: StepOutputSelector(
kind=[BATCH_OF_CLASSIFICATION_PREDICTION_KIND]
kind=[CLASSIFICATION_PREDICTION_KIND]
) = Field(
title="Classification results for crops",
description="The output of classification model for crops taken based on RoIs pointed as the other parameter",
Expand Down Expand Up @@ -94,9 +94,9 @@ def describe_outputs(cls) -> List[OutputDefinition]:
OutputDefinition(
name="predictions",
kind=[
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
],
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
OutputDefinition,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BOOLEAN_KIND,
DICTIONARY_KIND,
FLOAT_ZERO_TO_ONE_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
INTEGER_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
LIST_OF_VALUES_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
FloatZeroToOne,
StepOutputSelector,
WorkflowParameterSelector,
Expand Down Expand Up @@ -83,9 +83,9 @@ class BlockManifest(WorkflowBlockManifest):
predictions_batches: List[
StepOutputSelector(
kind=[
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_KEYPOINT_DETECTION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
KEYPOINT_DETECTION_PREDICTION_KIND,
]
),
] = Field(
Expand Down Expand Up @@ -162,7 +162,7 @@ def describe_outputs(cls) -> List[OutputDefinition]:
return [
OutputDefinition(
name="predictions",
kind=[BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND],
kind=[OBJECT_DETECTION_PREDICTION_KIND],
),
OutputDefinition(
name="object_present", kind=[BOOLEAN_KIND, DICTIONARY_KIND]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
WorkflowImageData,
)
from inference.core.workflows.execution_engine.entities.types import (
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
FLOAT_ZERO_TO_ONE_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
STRING_KIND,
FloatZeroToOne,
StepOutputImageSelector,
Expand Down Expand Up @@ -65,8 +65,8 @@ class BlockManifest(WorkflowBlockManifest):
)
predictions: StepOutputSelector(
kind=[
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
]
) = Field(
description="The output of a detection model describing the bounding boxes to be merged.",
Expand Down Expand Up @@ -105,8 +105,8 @@ def describe_outputs(cls) -> List[OutputDefinition]:
OutputDefinition(
name="predictions",
kind=[
BATCH_OF_OBJECT_DETECTION_PREDICTION_KIND,
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
OBJECT_DETECTION_PREDICTION_KIND,
INSTANCE_SEGMENTATION_PREDICTION_KIND,
],
),
]
Expand Down
Loading
Loading