Skip to content

Added box mask annotators - #422

Merged
SkalskiP merged 5 commits into
roboflow:developfrom
hardikdava:box_mask_annotator
Oct 6, 2023
Merged

SkalskiP merged 5 commits into
roboflow:developfrom
hardikdava:box_mask_annotator

Conversation

@hardikdava

Copy link
Copy Markdown
Contributor

Description

This PR is related to #421

List any dependencies that are required for this change.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

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

from ultralytics import YOLO
import cv2
import supervision as sv


image = cv2.imread("bus.jpg")

model = YOLO("yolov8n.pt")

detections = sv.Detections.from_ultralytics(model.predict(image, imgsz=416)[0])

box_mask_annotator = sv.BoxMaskAnnotator()
image = box_mask_annotator.annotate(image, detections)


cv2.imshow("Result", image)
cv2.waitKey(0)

Docs

  • Docs updated? What were the changes:

@hardikdava
hardikdava marked this pull request as ready for review October 5, 2023 16:00
@hardikdava
hardikdava requested a review from SkalskiP October 5, 2023 16:00
@hardikdava

Copy link
Copy Markdown
Contributor Author

@SkalskiP The document needs to be updated. Can you handle that?

@hardikdava

Copy link
Copy Markdown
Contributor Author

@onuralpszr Can you review this?

@hardikdava
hardikdava requested a review from onuralpszr October 6, 2023 17:40
@SkalskiP

SkalskiP commented Oct 6, 2023

Copy link
Copy Markdown
Collaborator

Hi, @hardikdava 馃憢馃徎! I'll take a look now.

color=color.as_bgr(),
thickness=-1,
)
scene = cv2.addWeighted(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@hardikdava we merge "faster" mask PR so we should replace that cv2.addWeighted this that code so it can be faster as well for start

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR link : #426

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.

Could that be relevant in the context of this PR as well #426 ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@SkalskiP yes

@SkalskiP

SkalskiP commented Oct 6, 2023

Copy link
Copy Markdown
Collaborator

btw, @hardikdava you know that you can create branches directly in supervision? You don't need to do it in your fork.

@SkalskiP SkalskiP linked an issue Oct 6, 2023 that may be closed by this pull request
@SkalskiP SkalskiP added enhancement New feature or request API:annotator Annotators hacktoberfest Open for contributions during the annual Hacktoberfest event, aimed at encouraging open-source parti labels Oct 6, 2023
@SkalskiP

SkalskiP commented Oct 6, 2023

Copy link
Copy Markdown
Collaborator

Example result:

box-mask-annotator-example

@SkalskiP

SkalskiP commented Oct 6, 2023

Copy link
Copy Markdown
Collaborator

@onuralpszr and @hardikdava I updated the docs and tested them. It works. Should we merge it and go back if people complain about performance in the future?

@onuralpszr

Copy link
Copy Markdown
Contributor

@onuralpszr and @hardikdava I updated the docs and tested them. It works. Should we merge it and go back if people complain about performance in the future?

Okay merge it. I also have different approach for performance I was thinking and we can always improve more too.

@onuralpszr onuralpszr added the hacktoberfest-accepted Contribute to the notion of open-source this October! label Oct 6, 2023
@SkalskiP
SkalskiP merged commit d30d807 into roboflow:develop Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API:annotator Annotators enhancement New feature or request hacktoberfest Open for contributions during the annual Hacktoberfest event, aimed at encouraging open-source parti hacktoberfest-accepted Contribute to the notion of open-source this October!

Projects

Status: Current Release: Done

Development

Successfully merging this pull request may close these issues.

Create sv.BoxMaskAnnotator

3 participants