Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8fa203a
feat: use expo router and add drawer to enhance ux
mlodyjesienin Jun 5, 2025
89dd2c5
feat: expo routers, drawer navigation, small fixes
mlodyjesienin Jun 10, 2025
09b523a
fix: deps for apps/computer-vision
mlodyjesienin Jun 11, 2025
cfb4fe9
fix: scheme and typos, computer-vision
mlodyjesienin Jun 11, 2025
ec4d27f
feat: disable camera on emulator for computer-vision
mlodyjesienin Jun 11, 2025
e261b9c
fix: Change order (OCR Vertical) in computer-vision
mlodyjesienin Jun 11, 2025
59fa5d7
fix: dependecies and scheme for app/llm
mlodyjesienin Jun 11, 2025
660020d
fix: disable voice chat on emulator and change to moonshine apps/llm/…
mlodyjesienin Jun 11, 2025
55e988f
fix: remove redundant llm tool calling information
mlodyjesienin Jun 11, 2025
62bbdad
work in progress - fix:switching between screens while model is gener…
mlodyjesienin Jun 12, 2025
4a0e7c4
feat: clear list button and disabled buttons logic for apps/text-embe…
mlodyjesienin Jun 12, 2025
9fad500
fix: proper your-scheme value in android/ files
mlodyjesienin Jun 16, 2025
fec4dc1
refactor: get rid of not used LlmContext
mlodyjesienin Jun 16, 2025
7eeebce
fix: after rebase main build issues
mlodyjesienin Jun 16, 2025
c503ab9
fix: after rebase main build issues, increase memory limit ios
mlodyjesienin Jun 16, 2025
9bc6d65
fix: fully removed wheel-scroll-picker from the deps
mlodyjesienin Jun 16, 2025
cd6c900
Added custom drawer content and forced reloads on Screen components w…
pweglik Jun 17, 2025
2741dcd
Merge branch '@mlodyjesienin/example-app-ui' remote with local
mlodyjesienin Jun 17, 2025
aa7a6b1
fix: truly disable camera in computer-vision on emulator
mlodyjesienin Jun 17, 2025
688ea55
refactor: rename ScreenWrapper to Pascal Case
mlodyjesienin Jun 18, 2025
7b9433f
fix: case sensitivity issues with renaming ScreenWrapper
mlodyjesienin Jun 18, 2025
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
129 changes: 0 additions & 129 deletions apps/computer-vision/App.tsx

This file was deleted.

8 changes: 8 additions & 0 deletions apps/computer-vision/ScreenWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { useIsFocused } from '@react-navigation/native';
import { PropsWithChildren } from 'react';

export default function ScreenWrapper({ children }: PropsWithChildren) {
const isFocused = useIsFocused();

return isFocused ? <>{children}</> : null;
}
6 changes: 6 additions & 0 deletions apps/computer-vision/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="rne-computer-vision"/>
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:statusBarColor">#ffffff</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
</style>
<style name="Theme.App.SplashScreen" parent="AppTheme">
<item name="android:windowBackground">@drawable/ic_launcher_background</item>
Expand Down
3 changes: 2 additions & 1 deletion apps/computer-vision/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"icon": "./assets/icons/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"scheme": "rne-computer-vision",
"splash": {
"image": "./assets/icons/splash.png",
"resizeMode": "contain",
Expand All @@ -29,6 +30,6 @@
"web": {
"favicon": "./assets/icons/favicon.png"
},
"plugins": ["expo-font"]
"plugins": ["expo-font", "expo-router"]
}
}
133 changes: 133 additions & 0 deletions apps/computer-vision/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import { Drawer } from 'expo-router/drawer';
import ColorPalette from '../colors';
import React, { useState } from 'react';
import { Text, StyleSheet, View } from 'react-native';

import {
DrawerContentComponentProps,
DrawerContentScrollView,
DrawerItemList,
} from '@react-navigation/drawer';
import { GeneratingContext } from '../context';

interface CustomDrawerProps extends DrawerContentComponentProps {
isGenerating: boolean;
}

function CustomDrawerContent(props: CustomDrawerProps) {
const { isGenerating, ...otherProps } = props;
return (
<DrawerContentScrollView {...otherProps}>
{!isGenerating ? (
<DrawerItemList {...otherProps} />
) : (
<View style={styles.centerContent}>
<Text style={styles.mainText}>Model is generating...</Text>
<Text style={styles.subText}>Interrupt before switching model</Text>
</View>
)}
</DrawerContentScrollView>
);
}

export default function _layout() {
const [isGenerating, setIsGenerating] = useState(false);

return (
<GeneratingContext
value={{
setGlobalGenerating: (newState: boolean) => {
setIsGenerating(newState);
},
}}
>
<Drawer
drawerContent={(props) => (
<CustomDrawerContent {...props} isGenerating={isGenerating} />
)}
screenOptions={{
drawerActiveTintColor: ColorPalette.primary,
drawerInactiveTintColor: '#888',
headerTintColor: ColorPalette.primary,
headerTitleStyle: { color: ColorPalette.primary },
}}
>
<Drawer.Screen
name="classification/index"
options={{
drawerLabel: 'Classification',
title: 'Classification',
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="image_segmentation/index"
options={{
drawerLabel: 'Image Segmentation',
title: 'Image Segmentation',
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="object_detection/index"
options={{
drawerLabel: 'Object Detection',
title: 'Object Detection',
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="ocr/index"
options={{
drawerLabel: 'OCR',
title: 'OCR',
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="ocr_vertical/index"
options={{
drawerLabel: 'OCR Vertical',
title: 'Vertical OCR',
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="style_transfer/index"
options={{
drawerLabel: 'Style Transfer',
title: 'Style Transfer',
headerTitleStyle: { color: ColorPalette.primary },
}}
/>
<Drawer.Screen
name="index"
options={{
drawerLabel: () => null,
title: 'Main Menu',
drawerItemStyle: { display: 'none' },
}}
/>
</Drawer>
</GeneratingContext>
);
}

const styles = StyleSheet.create({
centerContent: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 20,
},
mainText: {
fontSize: 18,
fontWeight: 'bold',
marginBottom: 10,
color: ColorPalette.primary,
},
subText: {
fontSize: 14,
color: ColorPalette.strongPrimary,
},
});
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import { useState } from 'react';
import Spinner from 'react-native-loading-spinner-overlay';
import { BottomBar } from '../components/BottomBar';
import { getImage } from '../utils';
import { getImage } from '../../utils';
import { useClassification, EFFICIENTNET_V2_S } from 'react-native-executorch';
import { View, StyleSheet, Image, Text, ScrollView } from 'react-native';
import { BottomBar } from '../../components/BottomBar';
import React, { useContext, useEffect, useState } from 'react';
import { GeneratingContext } from '../../context';
import ScreenWrapper from '../../ScreenWrapper';

export const ClassificationScreen = ({
imageUri,
setImageUri,
}: {
imageUri: string;
setImageUri: (imageUri: string) => void;
}) => {
export default function ClassificationScreen() {
const [results, setResults] = useState<{ label: string; score: number }[]>(
[]
);
const [imageUri, setImageUri] = useState('');

const model = useClassification({
modelSource: EFFICIENTNET_V2_S,
});
const { setGlobalGenerating } = useContext(GeneratingContext);
useEffect(() => {
setGlobalGenerating(model.isGenerating);
}, [model.isGenerating, setGlobalGenerating]);

const handleCameraPress = async (isCamera: boolean) => {
const image = await getImage(isCamera);
Expand Down Expand Up @@ -52,17 +53,16 @@ export const ClassificationScreen = ({
/>
);
}

return (
<>
<ScreenWrapper>
<View style={styles.imageContainer}>
<Image
style={styles.image}
resizeMode="contain"
source={
imageUri
? { uri: imageUri }
: require('../assets/icons/executorch_logo.png')
: require('../../assets/icons/executorch_logo.png')
}
/>
{results.length > 0 && (
Expand All @@ -83,9 +83,9 @@ export const ClassificationScreen = ({
handleCameraPress={handleCameraPress}
runForward={runForward}
/>
</>
</ScreenWrapper>
);
};
}

const styles = StyleSheet.create({
imageContainer: {
Expand Down
Loading
Loading