Skip to content

Speedup import time#1386

Merged
davidplowman merged 1 commit into
raspberrypi:nextfrom
nicolasdespres:speedup-import-time
May 13, 2026
Merged

Speedup import time#1386
davidplowman merged 1 commit into
raspberrypi:nextfrom
nicolasdespres:speedup-import-time

Conversation

@nicolasdespres
Copy link
Copy Markdown

Importing OpenCV on SD card is slow (~15sec).

This patch removes OpenCV import from the main path to speed up import time of imx500.

An alternative solution would be to use another library like Pillow which is faster to import and provide similar drawing performance.

@davidplowman davidplowman changed the base branch from main to next May 13, 2026 06:42
@davidplowman
Copy link
Copy Markdown
Collaborator

davidplowman commented May 13, 2026

Hi, thanks for this PR, this seems like a good idea. We're using Ruff now for code style checking and it had just a few little complaints - I think all it needs is to add a blank line after the new imports. Would you be OK to fix that and then I'm happy to merge when all the tests are happy. Thanks!

Edit: Oh, and please do also add a Signed-off-by: Name <email address> line to the commit message if you haven't done so already!

postprocess submodule relies on OpenCV which takes nearly 15s to
import on Raspberry Pi Zero 2 W with standard SD card.

With this patch it drops to nearly 4s (depending on file cache).
@davidplowman davidplowman merged commit 22fddca into raspberrypi:next May 13, 2026
3 of 4 checks passed
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