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

🛠️ [WIP] VisualizationPoC 2 #240

Conversation

ashwinvaidya17
Copy link
Collaborator

Customisable Visualization

Adds layout on top of the method proposed in #233.
Ignore the labels overlayed on top of each other. I will fix that later.

Default Visualizer

class AnomalyResult(Result):
   ...
   @property
    def default_layout(self) -> Layout:
        return Flatten(
            Overlay,
            Polygon,
            Label,
        )
visualizer = Visualizer()
visualizer.save(image, anomaly_result, "anomaly_default_layout.jpg")

Result

image

Custom Visualizer

layout = HStack(Polygon, Label, Flatten(Overlay, BoundingBoxes))
visualizer = Visualizer(layout=layout)
visualizer.save(image, anomaly_result, "anomaly_custom_layout.jpg")

Result

image

Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
@github-actions github-actions bot added the python python related changes label Nov 20, 2024
Copy link
Collaborator

@sovrasov sovrasov left a comment

Choose a reason for hiding this comment

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

Thanks Ashwin! Overall looks good. I see some generalization issues (like missing labels for bboxes), but that can be addressed when covering more tasks. Please don't forget to add unit tests for the implementation.

self.y1 = y1
self.x2 = x2
self.y2 = y2
self.color = color
Copy link
Collaborator

Choose a reason for hiding this comment

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

In multiclass detection task bbox also has a label, and it looks like bbox primitive needs to have it as well

@sovrasov sovrasov closed this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python python related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants