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

Added box mask annotators #422

Merged
merged 5 commits into from
Oct 6, 2023
Merged

Added box mask annotators #422

merged 5 commits into from
Oct 6, 2023

Conversation

hardikdava
Copy link
Collaborator

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
Copy link
Collaborator Author

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

@hardikdava
Copy link
Collaborator Author

@onuralpszr Can you review this?

@SkalskiP
Copy link
Collaborator

SkalskiP commented Oct 6, 2023

Hi, @hardikdava 👋🏻! I'll take a look now.

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

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
Collaborator

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
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
Collaborator

Choose a reason for hiding this comment

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

@SkalskiP yes

@SkalskiP
Copy link
Collaborator

SkalskiP commented Oct 6, 2023

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
Copy link
Collaborator

SkalskiP commented Oct 6, 2023

Example result:

box-mask-annotator-example

@SkalskiP
Copy link
Collaborator

SkalskiP commented Oct 6, 2023

@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
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?

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
4 checks passed
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