Installation
Prerequisites
Before installing react-native-nitro-inspire-face, you need to have react-native-nitro-modules set up in your project.
Installing the library
Install react-native-nitro-inspire-face through your preferred package manager:
- Expo
- NPM
- Yarn
- Bun
npx expo install react-native-nitro-modules react-native-nitro-inspire-face
npm install react-native-nitro-modules react-native-nitro-inspire-face
yarn add react-native-nitro-modules react-native-nitro-inspire-face
bun add react-native-nitro-modules react-native-nitro-inspire-face
Model Package Setup
This library requires model files from the InspireFace SDK to function. The models are available in different packages optimized for various use cases:
- Pikachu (Default) - Lightweight edge-side models (~15.8MB)
- Megatron - Mobile and server models (~60.2MB)
Download your chosen model package from the InspireFace Releases page.
Project Configuration
- Expo
- React Native CLI
Expo Setup
- Add the plugin to your Expo config (
app.json
,app.config.json
orapp.config.js
):
{
"expo": {
"plugins": [
[
"react-native-nitro-inspire-face",
{
"modelName": "Pikachu" // or "Megatron"
}
]
]
}
}
-
Place the model package in your project's root directory.
-
Run the command to copy the model package into both the iOS and Android platforms.
npx expo prebuild
Android Setup
Place your downloaded model package (e.g., "Pikachu") in the assets directory. If the directory doesn't exist yet, create it first:
android/app/src/main/assets/
└── Pikachu
iOS Setup
- Open your project in Xcode
- Right-click on your project in the navigator
- Select "Add Files to [Your Project Name]"
- Add the model package (e.g., "Pikachu")
- In the dialog that appears:
- Ensure "Copy items if needed" is checked
- Choose your app target
- Click "Add"
- Verify the model package appears in your target's "Copy Bundle Resources" build phase
Next Steps
Now that you have installed react-native-nitro-inspire-face and set up the model package, you can start using the library in your project. Check out the Basic Usage guide to learn how to implement face detection and recognition features.