Skip to content

[RNE Rewrite] revert(ocr): undo the preprocessor worklet change - #1381

Merged
msluszniak merged 2 commits into
rne-rewritefrom
@ms/revert-ocr-preprocessor-rewrite
Aug 24, 2026
Merged

[RNE Rewrite] revert(ocr): undo the preprocessor worklet change#1381
msluszniak merged 2 commits into
rne-rewritefrom
@ms/revert-ocr-preprocessor-rewrite

Conversation

@msluszniak

@msluszniak msluszniak commented Aug 24, 2026

Copy link
Copy Markdown
Member

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 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:

  • ocr_ops.cpp unclip guard keeps its single-line form, this PR does not touch the file
  • greedyCtcDecode keeps its hoisted const indices / const maxima

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

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

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@msluszniak msluszniak self-assigned this Aug 24, 2026
@msluszniak
msluszniak force-pushed the @ms/revert-ocr-preprocessor-rewrite branch from 5359713 to 9aa4a05 Compare August 24, 2026 15:54
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
msluszniak force-pushed the @ms/revert-ocr-preprocessor-rewrite branch from 9aa4a05 to c3577b7 Compare August 24, 2026 16:22
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 msluszniak added the bug fix PRs that are fixing bugs label Aug 24, 2026
@msluszniak
msluszniak force-pushed the @ms/revert-ocr-preprocessor-rewrite branch from c3577b7 to 63f40b5 Compare August 24, 2026 16:32
@msluszniak
msluszniak requested a review from barhanc August 24, 2026 16:32
@msluszniak msluszniak changed the title [RNE Rewrite] revert(ocr): undo the detector preprocessor rewrite [RNE Rewrite] revert(ocr): undo the preprocessor worklet change Aug 24, 2026
@msluszniak
msluszniak merged commit 5597a21 into rne-rewrite Aug 24, 2026
2 checks passed
@msluszniak
msluszniak deleted the @ms/revert-ocr-preprocessor-rewrite branch August 24, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants