perf: execute annotation rendering in parallel#182
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
f15e74b to
f3ec894
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR improves annotation rendering performance by parallelizing 2D and 3D annotation rendering tasks using an executor. The changes enable concurrent execution of annotation rendering operations that were previously sequential.
- Replaces sequential annotation rendering with parallel execution using
self._executor.submit() - Fixes a bug where
max_time_secondswas incorrectly used instead ofmax_timestamp_us - Removes TODO comments about speeding up annotation rendering
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| self._render_annotation2ds( | ||
| viewer=viewer, | ||
| first_sample_token=scene.first_sample_token, | ||
| max_timestamp_us=max_timestamp_us, |
There was a problem hiding this comment.
This line fixes a bug where max_time_seconds was incorrectly used instead of max_timestamp_us. However, the variable name suggests it should be in seconds, but it's being passed to a parameter expecting microseconds. Verify that the parameter naming and units are consistent throughout the codebase.
What
This pull request improves the performance of annotation rendering in the
t4_devkit/helper/rendering.pymodule by parallelizing the rendering of 2D and 3D annotations. The main change is the use of the executor to submit annotation rendering tasks concurrently, which should result in faster rendering times for both scenes and instances.Performance improvements in annotation rendering:
render_scenemethod, the calls to_render_annotation3dsand_render_annotation2dsare now submitted toself._executorfor parallel execution, allowing these tasks to run concurrently and speeding up the rendering process.render_instancemethod, the annotation rendering tasks (_render_annotation3dsand_render_annotation2ds) are also submitted in parallel usingself._executor, improving efficiency for instance-level rendering.