based on this code,
import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';
import { collection, addDoc } from 'firebase/firestore';
import jsonData from '/Users/user/mobilegaitapp/app/(tabs)/data/o2-74-9.json'; // Import JSON data
import * as tf from '@tensorflow/tfjs';
import { fetch, bundleResourceIO } from '@tensorflow/tfjs-react-native';
// Initialize Firebase
const firebaseConfig = {
apiKey: “AIzaSyDVbz-aiY7qqn02fXvkVTvXkVfdB4Na5BU”,
authDomain: “mobile-gait-app-41e79.firebaseapp.com”,
projectId: “mobile-gait-app-41e79”,
storageBucket: “mobile-gait-app-41e79.appspot.com”,
messagingSenderId: “27863890269”,
appId: “1:27863890269:web:cb928075afbac7720c10b4”,
measurementId: “G-M4EDSXW7FV”
};
const app = initializeApp(firebaseConfig);
// Connect Firestore to your Expo-managed React Native App
const db = getFirestore(app);
export default function App() {
async function loadModel(){
console.log("[+] Application started")
// Wait for tensorflow module to be ready
await tf.ready();
console.log("[+] Loading custom mask detection model");
// Replace model.json and group1-shard.bin with your own custom model
const modelJson = require("/Users/user/mobilegaitapp/assets/model/model.json");
const modelWeight = require("/Users/user/mobilegaitapp/assets/model/group1- shard1of1.bin");
// Load model
const model = await tf.loadLayersModel(bundleResourceIO(modelJson, modelWeight));
console.log("[+] Custom mask detection model loaded");
}
loadModel();
return null;
}
this code is in my index.tsx file when I try to deploy my deep learning model in react native expo go.
i have this error.
Android Bundling failed 4668ms node_modules/expo-router/entry.js (906 modules)
error: node_modules/expo-router/_ctx.android.js: /Users/user/mobilegaitapp/node_modules/expo-router/_ctx.android.js: Expected fromDir
to be of type string
, got undefined
i try to upgrade the package but still cannot. i do not understand why I cannot run the mobile application.
Hong Teng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.