Skip to content

Commit 616b0be

Browse files
committed
feat: update models in example apps to use quantized versions by default
1 parent a7f2f1c commit 616b0be

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

apps/computer-vision/app/classification/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Spinner from '../../components/Spinner';
22
import { getImage } from '../../utils';
3-
import { useClassification, EFFICIENTNET_V2_S } from 'react-native-executorch';
3+
import {
4+
useClassification,
5+
EFFICIENTNET_V2_S_QUANTIZED,
6+
} from 'react-native-executorch';
47
import { View, StyleSheet, Image, Text, ScrollView } from 'react-native';
58
import { BottomBar } from '../../components/BottomBar';
69
import React, { useContext, useEffect, useState } from 'react';
@@ -13,7 +16,7 @@ export default function ClassificationScreen() {
1316
);
1417
const [imageUri, setImageUri] = useState('');
1518

16-
const model = useClassification({ model: EFFICIENTNET_V2_S });
19+
const model = useClassification({ model: EFFICIENTNET_V2_S_QUANTIZED });
1720
const { setGlobalGenerating } = useContext(GeneratingContext);
1821
useEffect(() => {
1922
setGlobalGenerating(model.isGenerating);

apps/computer-vision/app/semantic_segmentation/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Spinner from '../../components/Spinner';
22
import { BottomBar } from '../../components/BottomBar';
33
import { getImage } from '../../utils';
44
import {
5-
DEEPLAB_V3_RESNET50,
5+
DEEPLAB_V3_MOBILENET_V3_LARGE_QUANTIZED,
66
useSemanticSegmentation,
77
} from 'react-native-executorch';
88
import {
@@ -46,7 +46,7 @@ export default function SemanticSegmentationScreen() {
4646
const { setGlobalGenerating } = useContext(GeneratingContext);
4747
const { isReady, isGenerating, downloadProgress, forward } =
4848
useSemanticSegmentation({
49-
model: DEEPLAB_V3_RESNET50,
49+
model: DEEPLAB_V3_MOBILENET_V3_LARGE_QUANTIZED,
5050
});
5151
const [imageUri, setImageUri] = useState('');
5252
const [imageSize, setImageSize] = useState({ width: 0, height: 0 });

apps/computer-vision/app/style_transfer/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { BottomBar } from '../../components/BottomBar';
33
import { getImage } from '../../utils';
44
import {
55
useStyleTransfer,
6-
STYLE_TRANSFER_CANDY,
6+
STYLE_TRANSFER_CANDY_QUANTIZED,
77
} from 'react-native-executorch';
88
import { View, StyleSheet, Image } from 'react-native';
99
import React, { useContext, useEffect, useState } from 'react';
1010
import { GeneratingContext } from '../../context';
1111
import ScreenWrapper from '../../ScreenWrapper';
1212

1313
export default function StyleTransferScreen() {
14-
const model = useStyleTransfer({ model: STYLE_TRANSFER_CANDY });
14+
const model = useStyleTransfer({ model: STYLE_TRANSFER_CANDY_QUANTIZED });
1515
const { setGlobalGenerating } = useContext(GeneratingContext);
1616
useEffect(() => {
1717
setGlobalGenerating(model.isGenerating);

apps/text-embeddings/app/clip-embeddings/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
useTextEmbeddings,
1616
useImageEmbeddings,
1717
CLIP_VIT_BASE_PATCH32_TEXT,
18-
CLIP_VIT_BASE_PATCH32_IMAGE,
18+
CLIP_VIT_BASE_PATCH32_IMAGE_QUANTIZED,
1919
} from 'react-native-executorch';
2020
import { launchImageLibrary } from 'react-native-image-picker';
2121
import { useIsFocused } from '@react-navigation/native';
@@ -29,7 +29,9 @@ export default function ClipEmbeddingsScreenWrapper() {
2929

3030
function ClipEmbeddingsScreen() {
3131
const textModel = useTextEmbeddings({ model: CLIP_VIT_BASE_PATCH32_TEXT });
32-
const imageModel = useImageEmbeddings({ model: CLIP_VIT_BASE_PATCH32_IMAGE });
32+
const imageModel = useImageEmbeddings({
33+
model: CLIP_VIT_BASE_PATCH32_IMAGE_QUANTIZED,
34+
});
3335

3436
const [inputSentence, setInputSentence] = useState('');
3537
const [sentencesWithEmbeddings, setSentencesWithEmbeddings] = useState<

0 commit comments

Comments
 (0)