Skip to content

Commit 962b3df

Browse files
authored
Use Hugging Face classification models (#60)
## Description Use classification models from Hugging Face ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update (improves or adds clarity to existing documentation) ### Tested on - [x] iOS - [x] Android ### Checklist - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings
1 parent 240af5b commit 962b3df

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed
Binary file not shown.
Binary file not shown.

examples/computer-vision/models/classification.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/computer-vision/screens/ClassificationScreen.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { useState } from 'react';
22
import Spinner from 'react-native-loading-spinner-overlay';
33
import { BottomBar } from '../components/BottomBar';
4-
import { efficientnet_v2_s } from '../models/classification';
54
import { getImageUri } from '../utils';
6-
import { useClassification } from 'react-native-executorch';
5+
import { useClassification, EFFICIENTNET_V2_S } from 'react-native-executorch';
76
import { View, StyleSheet, Image, Text, ScrollView } from 'react-native';
87

98
export const ClassificationScreen = ({
@@ -18,7 +17,7 @@ export const ClassificationScreen = ({
1817
);
1918

2019
const model = useClassification({
21-
modulePath: efficientnet_v2_s,
20+
modulePath: EFFICIENTNET_V2_S,
2221
});
2322

2423
const handleCameraPress = async (isCamera: boolean) => {

src/constants/modelUrls.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
//LLM's
2-
31
import { Platform } from 'react-native';
42

3+
// LLM's
54
export const LLAMA3_2_3B_URL =
65
'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-3B/original/llama3_2_3B_bf16.pte';
76
export const LLAMA3_2_3B_QLORA_URL =
@@ -19,7 +18,13 @@ export const LLAMA3_2_1B_TOKENIZER =
1918
export const LLAMA3_2_3B_TOKENIZER =
2019
'https://huggingface.co/software-mansion/react-native-executorch-llama-3.2/resolve/v0.1.0/llama-3.2-3B/original/tokenizer.bin';
2120

22-
//Style transfer
21+
// Classification
22+
export const EFFICIENTNET_V2_S =
23+
Platform.OS === 'ios'
24+
? 'https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s/resolve/v0.2.0/coreml/efficientnet_v2_s_coreml_all.pte'
25+
: 'https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s/resolve/v0.2.0/xnnpack/efficientnet_v2_s_xnnpack.pte';
26+
27+
// Style transfer
2328
export const STYLE_TRANSFER_CANDY =
2429
Platform.OS === 'ios'
2530
? 'https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy/resolve/v0.2.0/coreml/style_transfer_candy_coreml.pte'

0 commit comments

Comments
 (0)