Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0eae3f7
fix: correct frame data extraction
NorbertKlockiewicz Feb 11, 2026
65667ad
feat: frame extractor for zero-copy approach
NorbertKlockiewicz Feb 12, 2026
daed38a
chore: num minSdkVersion to 26
NorbertKlockiewicz Feb 13, 2026
3d534de
feat: unify frame extraction and preprocessing
NorbertKlockiewicz Feb 16, 2026
9ce35da
feat: remove unused bindJSIMethods
NorbertKlockiewicz Feb 16, 2026
66af65c
feat: initial version of vision model API
NorbertKlockiewicz Feb 17, 2026
6e413ac
refactor: errors, logs, unnecessary comments, use existing TensorPtr
NorbertKlockiewicz Feb 17, 2026
53bcd96
fix: change Frame import in BaseModule
NorbertKlockiewicz Feb 17, 2026
cd0b123
feat: use TensorPtrish type for Pixel data input
NorbertKlockiewicz Feb 18, 2026
e001142
refactor: add or remove empty lines
NorbertKlockiewicz Feb 18, 2026
ca60d88
fix: errors after rebase
NorbertKlockiewicz Feb 19, 2026
62df7ce
fix: remove redundant preprocessing step
NorbertKlockiewicz Feb 20, 2026
962f1c3
refactor: changes suggested in review
NorbertKlockiewicz Feb 23, 2026
7753bd1
fix: not existing error type, add comments to JSI code
NorbertKlockiewicz Feb 23, 2026
a9c01a9
feat: add new PlatformNotSupported error
NorbertKlockiewicz Feb 23, 2026
98395af
fix: compilation JSI error
NorbertKlockiewicz Feb 23, 2026
ffcf72f
feat: add tests for generateFromPixels method
NorbertKlockiewicz Feb 23, 2026
44676fc
feat: add example screen with vision camera to computer vision app
NorbertKlockiewicz Feb 23, 2026
983242e
feat: suggested changes / improve comments
NorbertKlockiewicz Feb 24, 2026
e0e8bca
fix(android): object detection not working on android
NorbertKlockiewicz Feb 25, 2026
3aa0f89
chore: remove unused ImageSegmentation.cpp
NorbertKlockiewicz Feb 25, 2026
fd5aca7
docs: add correct api references
NorbertKlockiewicz Feb 25, 2026
5ddad2f
feat: frame extractor for zero-copy approach
NorbertKlockiewicz Feb 12, 2026
4186663
feat: unify frame extraction and preprocessing
NorbertKlockiewicz Feb 16, 2026
6a89b08
feat: initial version of vision model API
NorbertKlockiewicz Feb 17, 2026
fafb2cc
refactor: errors, logs, unnecessary comments, use existing TensorPtr
NorbertKlockiewicz Feb 17, 2026
081d6ac
refactor: add or remove empty lines
NorbertKlockiewicz Feb 18, 2026
6192a4a
fix: errors after rebase
NorbertKlockiewicz Feb 19, 2026
f910865
feat: suggested changes / improve comments
NorbertKlockiewicz Feb 24, 2026
0a8493b
feat: make all cv models compatible with Vision Camera
NorbertKlockiewicz Feb 25, 2026
622e8d5
fix: rebase things
NorbertKlockiewicz Feb 25, 2026
dc5e65e
chore: remove comment
NorbertKlockiewicz Feb 25, 2026
2c8dd67
feat: add dedicated vision camera screen showcasing classification/se…
NorbertKlockiewicz Feb 26, 2026
224cbbf
fix: drawing style transfer image
NorbertKlockiewicz Feb 26, 2026
09b420f
fix: tests
NorbertKlockiewicz Feb 26, 2026
a06a8b5
feat: add possibility to switch between front/back camera
NorbertKlockiewicz Feb 26, 2026
787ea7d
fix: rotation issue
NorbertKlockiewicz Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cspell-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ antonov
rfdetr
basemodule
IMAGENET
worklet
worklets
BGRA
16 changes: 14 additions & 2 deletions apps/computer-vision/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,23 @@
"foregroundImage": "./assets/icons/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.anonymous.computervision"
"package": "com.anonymous.computervision",
"permissions": ["android.permission.CAMERA"]
},
"web": {
"favicon": "./assets/icons/favicon.png"
},
"plugins": ["expo-font", "expo-router"]
"plugins": [
"expo-font",
"expo-router",
[
"expo-build-properties",
{
"android": {
"minSdkVersion": 26
}
}
]
]
}
}
9 changes: 9 additions & 0 deletions apps/computer-vision/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export default function _layout() {
headerTitleStyle: { color: ColorPalette.primary },
}}
>
<Drawer.Screen
name="vision_camera/index"
options={{
drawerLabel: 'Vision Camera',
title: 'Vision Camera',
headerShown: false,
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="classification/index"
options={{
Expand Down
6 changes: 6 additions & 0 deletions apps/computer-vision/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export default function Home() {
<ExecutorchLogo width={64} height={64} />
<Text style={styles.headerText}>Select a demo model</Text>
<View style={styles.buttonContainer}>
<TouchableOpacity
style={styles.button}
onPress={() => router.navigate('vision_camera/')}
>
<Text style={styles.buttonText}>Vision Camera</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() => router.navigate('classification/')}
Expand Down
75 changes: 64 additions & 11 deletions apps/computer-vision/app/style_transfer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import {
useStyleTransfer,
STYLE_TRANSFER_CANDY,
} from 'react-native-executorch';
import {
Canvas,
Image as SkiaImage,
Skia,
AlphaType,
ColorType,
SkImage,
} from '@shopify/react-native-skia';
import { View, StyleSheet, Image } from 'react-native';
import React, { useContext, useEffect, useState } from 'react';
import { GeneratingContext } from '../../context';
Expand All @@ -16,20 +24,38 @@ export default function StyleTransferScreen() {
useEffect(() => {
setGlobalGenerating(model.isGenerating);
}, [model.isGenerating, setGlobalGenerating]);

const [imageUri, setImageUri] = useState('');
const [styledImage, setStyledImage] = useState<SkImage | null>(null);
const [canvasSize, setCanvasSize] = useState({ width: 1, height: 1 });

const handleCameraPress = async (isCamera: boolean) => {
const image = await getImage(isCamera);
const uri = image?.uri;
if (typeof uri === 'string') {
setImageUri(uri as string);
setImageUri(uri);
setStyledImage(null);
}
};

const runForward = async () => {
if (imageUri) {
try {
const output = await model.forward(imageUri);
setImageUri(output);
const height = output.sizes[0];
const width = output.sizes[1];
const skData = Skia.Data.fromBytes(output.dataPtr);
const img = Skia.Image.MakeImage(
{
width,
height,
alphaType: AlphaType.Opaque,
colorType: ColorType.RGBA_8888,
},
skData,
width * 4
);
setStyledImage(img);
} catch (e) {
console.error(e);
}
Expand All @@ -48,15 +74,38 @@ export default function StyleTransferScreen() {
return (
<ScreenWrapper>
<View style={styles.imageContainer}>
<Image
style={styles.image}
resizeMode="contain"
source={
imageUri
? { uri: imageUri }
: require('../../assets/icons/executorch_logo.png')
}
/>
{styledImage ? (
<View
style={styles.canvas}
onLayout={(e) =>
setCanvasSize({
width: e.nativeEvent.layout.width,
height: e.nativeEvent.layout.height,
})
}
>
<Canvas style={StyleSheet.absoluteFill}>
<SkiaImage
image={styledImage}
fit="contain"
x={0}
y={0}
width={canvasSize.width}
height={canvasSize.height}
/>
</Canvas>
</View>
) : (
<Image
style={styles.image}
resizeMode="contain"
source={
imageUri
? { uri: imageUri }
: require('../../assets/icons/executorch_logo.png')
}
/>
)}
</View>
<BottomBar
handleCameraPress={handleCameraPress}
Expand All @@ -77,4 +126,8 @@ const styles = StyleSheet.create({
borderRadius: 8,
width: '100%',
},
canvas: {
flex: 1,
width: '100%',
},
});
Loading