[RNE Rewrite] revert(ocr): undo the preprocessor worklet change - #1381
Merged
Conversation
msluszniak
force-pushed
the
@ms/revert-ocr-preprocessor-rewrite
branch
from
August 24, 2026 15:54
5359713 to
9aa4a05
Compare
Part of 4ed38b7, which landed with #1322, rewrote the PaddleOCR detector path to stop using createImagePreprocessor and inline the resize/convert/normalize chain instead. That was not part of the review it claimed to address. Reverts that path only. Everything else from that commit stays: the unclip guard in ocr_ops.cpp, the hoisted typed-array allocations in greedyCtcDecode, and the removal of the worklet directives from createImagePreprocessor.
msluszniak
force-pushed
the
@ms/revert-ocr-preprocessor-rewrite
branch
from
August 24, 2026 16:22
9aa4a05 to
c3577b7
Compare
Reverts the part of 4ed38b7 that acted on the review note about the worklet directives on createImagePreprocessor. The note does not hold: the OCR detector builds a preprocessor per page inside the worklet, so the constructor and its dispose have to be callable there. Restores the directives and the detector's use of createImagePreprocessor. The other two notes from the same commit stay applied: the unclip guard in ocr_ops.cpp, which this PR does not touch, and the hoisted typed-array allocations in greedyCtcDecode.
msluszniak
force-pushed
the
@ms/revert-ocr-preprocessor-rewrite
branch
from
August 24, 2026 16:32
c3577b7 to
63f40b5
Compare
barhanc
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reverts the part of 4ed38b7, which landed with #1322, that acted on the review note about the worklet directives on
createImagePreprocessor. The note does not hold: the OCR detector builds a preprocessor per page inside the worklet, so the constructor and itsdisposehave to be callable there.Restores the directives and the detector's use of
createImagePreprocessor.The other two notes from the same commit stay applied:
ocr_ops.cppunclip guard keeps its single-line form, this PR does not touch the filegreedyCtcDecodekeeps its hoistedconst indices/const maximaIntroduces a breaking change?
Type of change
Tested on
Testing instructions
Open the OCR screen in
apps/computer-vision, pick an image with text and run PaddleOCR. Without this revert the run fails on the worklet runtime with[Worklets] Tried to synchronously call a Remote Function. Called "createImagePreprocessor" on the ExecuTorchDefaultRuntime Runtime.Screenshots
Related issues
#1322
Checklist
Additional notes