feat: add integration with vision camera v5#810
Open
NorbertKlockiewicz wants to merge 25 commits intomainfrom
Open
feat: add integration with vision camera v5#810NorbertKlockiewicz wants to merge 25 commits intomainfrom
NorbertKlockiewicz wants to merge 25 commits intomainfrom
Conversation
96f2c14 to
f3e17e2
Compare
msluszniak
reviewed
Feb 23, 2026
packages/react-native-executorch/common/rnexecutorch/host_objects/JsiConversions.h
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/common/rnexecutorch/host_objects/ModelHostObject.h
Show resolved
Hide resolved
packages/react-native-executorch/common/rnexecutorch/metaprogramming/TypeConcepts.h
Show resolved
Hide resolved
packages/react-native-executorch/common/rnexecutorch/tests/integration/ObjectDetectionTest.cpp
Outdated
Show resolved
Hide resolved
c1ff490 to
983242e
Compare
msluszniak
approved these changes
Feb 25, 2026
Member
msluszniak
left a comment
There was a problem hiding this comment.
LGTM, but I would wait for a review from someone that knows TS more than me ;)
chmjkb
reviewed
Feb 26, 2026
Comment on lines
+61
to
+64
| /** | ||
| * Thrown when a feature or platform is not supported in the current environment. | ||
| */ | ||
| PlatformNotSupported = 119, |
Collaborator
There was a problem hiding this comment.
Make sure to add this to error handling docs
| model, | ||
| preventLoad: preventLoad, | ||
| }); | ||
| }) as ObjectDetectionType; |
Collaborator
There was a problem hiding this comment.
do we need the type assertion here?
| const [isGenerating, setIsGenerating] = useState(false); | ||
| const [downloadProgress, setDownloadProgress] = useState(0); | ||
| const [moduleInstance] = useState(() => new module()); | ||
| const [runOnFrame, setRunOnFrame] = useState<any>(null); |
Comment on lines
51
to
57
| // Use "state trick" to make the worklet serializable for VisionCamera | ||
| if ('runOnFrame' in moduleInstance) { | ||
| const worklet = moduleInstance.runOnFrame; | ||
| if (worklet) { | ||
| setRunOnFrame(() => worklet); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Maybe it would be explaining what the state trick is and why we need it
Comment on lines
172
to
178
| export interface PixelData extends Omit<TensorPtr, 'dataPtr' | 'scalarType'> { | ||
| /** | ||
| * RGB pixel data as Uint8Array. | ||
| * Expected format: RGB (3 channels), not RGBA or BGRA. | ||
| * Size must equal: width * height * 3 | ||
| */ | ||
| dataPtr: Uint8Array; |
Collaborator
There was a problem hiding this comment.
I think this should be Pick instead
chmjkb
requested changes
Feb 26, 2026
74be0c6 to
28a7bad
Compare
Member
|
I think you need to rebase because your changes to auto-generated api is as for the older code (before my commit with packages bump). |
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
This PR adds real-time camera frame processing capabilities to React Native ExecuTorch by integrating with VisionCamera v5. It introduces a new VisionModule base class and extends ObjectDetectionModule to support three input methods: image URLs/paths, raw pixel data (PixelData), and live camera frames.
This PR includes:
Introduces a breaking change?
Type of change
Tested on
Testing instructions
Run the computer vision example app and test object detection and object detection (live)
Screenshots
Related issues
Checklist
Additional notes