Skip to content

Enable users to draw custom objects #229

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

Merged
merged 2 commits into from
Dec 26, 2022
Merged

Conversation

javiber
Copy link
Collaborator

@javiber javiber commented Dec 20, 2022

This PR addresses a specific use-case when the users want to draw a TrackedObject but they only have the data of the object and not the instance. This can happen when the TrackedObject is serialized and restored.

It's hard (if not impossible) for users to instantiate a TrackedObject directly when they want to draw it. With this change, the Drawable class can be instantiated directly and then drawn like so:

draw_boxes(
    frame,
    drawables=[
        Drawable(
            points=np.array([[20, 20], [50, 90]]),
            label="person",
            id=123,
            scores=np.array([0.88]),
        )
    ],
)

@DiegoFernandezC DiegoFernandezC merged commit 432a75a into master Dec 26, 2022
@DiegoFernandezC DiegoFernandezC deleted the drawing-custom-objects branch December 26, 2022 19:16
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