Skip to content

feat: preprocessing in python for NPU#414

Merged
tybulewicz merged 3 commits into
masterfrom
mgumowsk/408-move-pre-processing-for-npu
Oct 14, 2025
Merged

feat: preprocessing in python for NPU#414
tybulewicz merged 3 commits into
masterfrom
mgumowsk/408-move-pre-processing-for-npu

Conversation

@mgumowsk

@mgumowsk mgumowsk commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #408

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@mgumowsk mgumowsk requested a review from a team as a code owner October 2, 2025 11:00
@github-actions github-actions Bot added the python python related changes label Oct 2, 2025
@mgumowsk mgumowsk changed the title feat: preprocessing in python for NPU WIP feat: preprocessing in python for NPU Oct 3, 2025
@mgumowsk mgumowsk changed the title WIP feat: preprocessing in python for NPU feat: preprocessing in python for NPU Oct 14, 2025
@tybulewicz tybulewicz requested a review from Copilot October 14, 2025 08:45

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 adds preprocessing support in Python for NPU devices to improve compatibility and performance. The changes implement Python-based preprocessing pipelines as an alternative to embedded preprocessing for NPU devices, while also refactoring shared preprocessing logic and fixing method calls for label handling.

  • Adds NPU-specific Python preprocessing pipeline setup
  • Refactors ONNX adapter to use shared preprocessing utilities
  • Fixes label access methods in tiler classes

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/model_api/adapters/utils.py Adds shared preprocessing pipeline setup function and layout change utility
src/model_api/adapters/openvino_adapter.py Implements NPU device detection, dynamic input reshaping, and Python preprocessing
src/model_api/adapters/onnx_adapter.py Refactors to use shared preprocessing utilities and updates copyright year
src/model_api/models/anomaly.py Adds NPU-specific dynamic shape handling and image resizing in preprocessing
src/model_api/tilers/detection.py Updates label access to use get_label_name method
src/model_api/tilers/instance_segmentation.py Updates label access to use get_label_name method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/model_api/adapters/utils.py
Comment thread src/model_api/adapters/utils.py
Comment thread src/model_api/adapters/openvino_adapter.py
Comment thread src/model_api/adapters/openvino_adapter.py
@tybulewicz tybulewicz enabled auto-merge October 14, 2025 09:08
@tybulewicz tybulewicz added this pull request to the merge queue Oct 14, 2025
Merged via the queue into master with commit da6f46e Oct 14, 2025
17 checks passed
@tybulewicz tybulewicz deleted the mgumowsk/408-move-pre-processing-for-npu branch October 14, 2025 09:15
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.

Move pre-processing to python

3 participants