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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/inference slicer segmentation #1178
Conversation
from supervision.utils.image import crop_image | ||
|
||
|
||
def move_detections(detections: Detections, offset: np.array) -> Detections: | ||
def move_detections( | ||
detections: Detections, offset: np.ndarray, image_shape: np.ndarray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argument image_shape
is called resolution_wh
in most places in supervision
. Let's keep it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think it should be Optional
.
Also please add |
supervision/detection/utils.py
Outdated
def move_masks( | ||
masks: np.ndarray, | ||
offset: np.ndarray, | ||
desired_shape: Optional[Union[Tuple[int, int, int], Tuple[int, int]]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just resolution_wh
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sounds good, will change it
Description
Prerequisites:
This allows the slicer to merge segmentation masks.
Previously it would fail when attempting to stack slices of different sizes, as there'd be no attempts to move & pad the slices. The result is that each mask would be of size(slice), rather than size(image).
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
Same notebook as for prior PR.
馃摀 Google Colab
Any specific deployment considerations
NONE
.Docs