[go: nahoru, domu]

Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Is there a way to display multiple box annotation colours for different object detections based on multiple tracker ids? #172

Closed
1 task done
epochDVKHN opened this issue Jul 3, 2023 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@epochDVKHN
Copy link

Search before asking

  • I have searched the Supervision issues and found no similar feature requests.

Question

First of all, thank you so much for Supervision. It is amazing.

So, in my object detection tracking, sometimes I track multiple objects and sometimes I track only one object. However, regardless of the case, I want to be able to display a unique bounding box colour based on the corresponding tracking ID.
As far as I know, there exists a method called by_idx() which returns a unique colour for one ID only. Is there a way to include multiple IDs for this?

# Defining the bounding box annotator
box_annotator = sv.BoxAnnotator(
     color=sv.ColorPalette.default().by_idx(
        idx=tracker_detections.tracker_id
     ),
     thickness=3,
     text_color=sv.Color.white(),
     text_scale=0.8,
     text_thickness=1,
     text_padding=10,
)

tracker_detections is a supervision Detections object.
Yes, I am getting an error in this code since by_idx() only supports a single integer and not an array of integers. Is there any workaround for this?

Additional

No response

@epochDVKHN epochDVKHN added the question Further information is requested label Jul 3, 2023
@github-actions
Copy link
Contributor
github-actions bot commented Jul 3, 2023

Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap.

@hardikdava
Copy link
Collaborator

@ElNoSabe322 Thank you for reaching out. Currently, sv.BoxAnnotator supports either single color to all instances or color based on class id i.e. by_idx(class_id). Thank for your suggestion to consider color by track id. We will consider it. It is highly recommended to visualize object trajectories with different color. We are currently working on improving different Annotators. You can check the progress #170. Stay tune for more updates!

@epochDVKHN
Copy link
Author

@hardikdava Thank you for your reply! Yeah, I'm really looking forward to the new re-designed annotators, especially with the trail track annotation and the box mask annotation. Can't wait for the new Supervision version. 😁👏

@hardikdava
Copy link
Collaborator

@ElNoSabe322 You might be interested in #49 . FYI: this feature will be available very soon.

@epochDVKHN
Copy link
Author

Yeah, I cannot wait to see this feature in action. This will be a lifesaver!! 😌🙏

@epochDVKHN
Copy link
Author

I found a temporary workaround for this issue until the new update comes.
Basically, I made a separate supervision detection class object for each tracked object and in this way I can pass one tracker_id at a time. Therefore, for n tracked objects, there will be n detection class objects and n box annotators and n annotate function calls.
This is not time and memory efficient especially if n is large so yeah... looking forward to the new update. 🙏

@hardikdava should I close this issue or should I leave it open until the update includes this?

@hardikdava
Copy link
Collaborator
hardikdava commented Jul 4, 2023

@ElNoSabe322 Thank you for your comments. You can leave this issue open. We will let you know when this feature is implemented.

@SkalskiP SkalskiP self-assigned this Jul 4, 2023
@SkalskiP
Copy link
Collaborator

Hi @ElNoSabe322 and @hardikdava, I'm doing supervision housekeeping. I'm converting this question into a discussion and moving it to the QA section.

@roboflow roboflow locked and limited conversation to collaborators Jul 18, 2023
@SkalskiP SkalskiP converted this issue into discussion #200 Jul 18, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants