Skip to content

Add a Detection union block#1069

Merged
grzegorz-roboflow merged 14 commits intomainfrom
detections-union
Mar 14, 2025
Merged

Add a Detection union block#1069
grzegorz-roboflow merged 14 commits intomainfrom
detections-union

Conversation

@hansent
Copy link
Copy Markdown
Collaborator

@hansent hansent commented Mar 11, 2025

Description

Adds a DetectionsMerge block that can be used to merge several detections into a single object detection bounding box. E.g. to crop section of image containing all detections.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

unit tests

Any specific deployment considerations

n/a

Docs

added via workflows gallery build decorator

type: Literal["roboflow_core/detections_merge@v1"]
predictions: Selector(
kind=[
OBJECT_DETECTION_PREDICTION_KIND,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

not sure if this should be only
OBJECT_DETECTION_PREDICTION_KIND and INSTANCE_SEGMENTATION_PREDICTION_KIND (tested with those two), but I think KEYPOINT_DETECTION_PREDICTION_KIND should also be OK / we have bounding box info via detections?

@hansent hansent marked this pull request as ready for review March 13, 2025 20:10
else None
),
class_id=(
np.array([predictions.class_id[0]], dtype=np.int32)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

picking one of the classes here. other options might be:

  • use. hardcoded class like "merged_detections", but seem odd to introduce a special classname / could potentially conflict with other class named the same
    • although could make this configurable also as a property
  • use the most common one?

I think use cases probably mostly for getting the box coordiantes and class wont matter

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think if we merge everything then maybe most common class name would make sense, but maybe we should produce as many detections as many classes we have?

@grzegorz-roboflow grzegorz-roboflow merged commit ebbc9ee into main Mar 14, 2025
30 checks passed
@grzegorz-roboflow grzegorz-roboflow deleted the detections-union branch March 14, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants