The beginning of the app.tsx file for my react native app looks like this:
import {PaintStyle, Skia} from '@shopify/react-native-skia';
import React, {useEffect} from 'react';
import {StyleSheet, Text} from 'react-native';
import {
Camera,
useCameraDevice,
useCameraPermission,
VisionCameraProxy,
Frame,
useSkiaFrameProcessor,
} from 'react-native-vision-camera';
import { useTensorflowModel } from 'react-native-fast-tflite';
import RNFS from 'react-native-fs';
const plugin = VisionCameraProxy.initFrameProcessorPlugin('myPlugin', {});
it works perfectly this way. I have built the app and downloaded it to my iPhone using XCode and it builds perfectly. However, when I try to use a tensorflow model I have imported by adding the line:
const modelPlugin = useTensorflowModel(require('../assets/model.tflite'));
I get a "Phase Script Execution Failed with nonzero exit code" error from xcode and the build is not completed. I suspect the issue is with where the model is in my folder hierarchy even though I did exactly as directed on the react-native-fast-tflite github. Do I need to somehow save it as a Target in XCode or something? Any help is greatly appreciated.
I have isolated the issue to be the line:
const modelPlugin = useTensorflowModel(require('../assets/model.tflite'));
Without it, the app builds. With it, there is an error. I have tried saving the model in the ios folder through XCode and adding it as a target, but this had no effect.