Skip to content

perf: execute annotation rendering in parallel#182

Merged
ktro2828 merged 4 commits into
mainfrom
perf/viewer/render-annotation
Aug 29, 2025
Merged

perf: execute annotation rendering in parallel#182
ktro2828 merged 4 commits into
mainfrom
perf/viewer/render-annotation

Conversation

@ktro2828

Copy link
Copy Markdown
Collaborator

What

This pull request improves the performance of annotation rendering in the t4_devkit/helper/rendering.py module 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:

  • In the render_scene method, the calls to _render_annotation3ds and _render_annotation2ds are now submitted to self._executor for parallel execution, allowing these tasks to run concurrently and speeding up the rendering process.
  • In the render_instance method, the annotation rendering tasks (_render_annotation3ds and _render_annotation2ds) are also submitted in parallel using self._executor, improving efficiency for instance-level rendering.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings August 29, 2025 09:59
@github-actions github-actions Bot added the refactor Refactoring code or increasing performance label Aug 29, 2025
@ktro2828 ktro2828 requested review from Copilot and removed request for Copilot August 29, 2025 09:59
@github-actions

github-actions Bot commented Aug 29, 2025

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ❌

Overall Coverage

Lines Covered Coverage Threshold Status
2649 1836 69% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/helper/rendering.py 13% 🔴
TOTAL 13% 🔴

updated for commit: f3ec894 by action🐍

This comment was marked as outdated.

ktro2828 and others added 3 commits August 29, 2025 19:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ktro2828 ktro2828 force-pushed the perf/viewer/render-annotation branch from f15e74b to f3ec894 Compare August 29, 2025 10:09
@ktro2828 ktro2828 requested a review from Copilot August 29, 2025 10:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_seconds was incorrectly used instead of max_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,

Copilot AI Aug 29, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@ktro2828 ktro2828 merged commit a4c9753 into main Aug 29, 2025
5 checks passed
@ktro2828 ktro2828 deleted the perf/viewer/render-annotation branch August 29, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code or increasing performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants