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
[CodeCamp2023-305] Improve Visualizer Rendering Speed with OpenCV Backend #1285
base: main
Are you sure you want to change the base?
[CodeCamp2023-305] Improve Visualizer Rendering Speed with OpenCV Backend #1285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be better to provide the visualization result of cv2
backend in the PR messages 😄
Oki, I will update my code and docstring mentioned above as soon as posible. |
Please present the visualization results using both the cv2 and matplotlib backends to verify their correctness. |
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Hi, here is my vis result:https://github.com/KerwinKai/cv2_backend_for_mmengine/tree/main/cv2_backend_result |
Here is my new result, the self._image order Here is an example to draw and save point image in two backend:
See more details in: https://github.com/KerwinKai/cv2_backend_for_mmengine/blob/main/cv2_backend_result/generate.py |
Hi, how about standardizing the input format to be RGB for all interfaces? This would facilitate interface consistency. If necessary in the future, we can provide an additional parameter to specify the |
Does that mean that all functions such as
We will get a |
Got it, standard the input format to be RGB for all interfaces now and update relate docstring. |
line_styles=['-', '-.'], | ||
line_widths=[1, 2]) | ||
line_styles=line_styles, | ||
line_widths=[1, 2.1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to change 2
to 2.1
here?
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Could you also update the images in https://github.com/KerwinKai/cv2_backend_for_mmengine/tree/main/cv2_backend_result/images using the latest commit? |
Oki, already update it. |
I fix my code to orgin version in main mmengine and update https://github.com/KerwinKai/cv2_backend_for_mmengine/tree/main/cv2_backend_result/images again. The different now I thick may cause by line 1194.
|
Here is a use example in larger size image: https://github.com/KerwinKai/cv2_backend_for_mmengine/tree/main/cv2_backend_result/test_binary_masks_in_larger_image |
this seems like a solid enhancement, why not getting merged? |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
As #1101 described.
Modification
I have shown the design ideas in functions such as
__init__
,get_image
,draw_lines
, etc. The basic idea is to add a parameter calledbackend
to theVisualizer
to control whether the rendering backend used for drawing iscv2
ormatplotlib
. The design idea of the drawing function is basically the same as that ofdraw_lines
, that is, the original parameters of the function can be input into the drawing function of cv2 as much as possible. If it is not possible, a prompt will be thrown. This is my first draft, which shows the overall implementation idea of this task. If my idea have any problems, please correct me in time. I will complete the remaining code, documents and test cases as soon as possible.BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist