@infinitered/react-native-mlkit-face-detection@3.0.0
Major Changes
- b668ab0: Upgrade to expo 52
Face Detection
- Changed option naming conventions to match ML Kit SDK patterns:
detectLandmarks
→landmarkMode
runClassifications
→classificationMode
- Changed default
performanceMode
fromaccurate
tofast
- Renamed hook from
useFaceDetector
touseFaceDetection
- Renamed context provider from
RNMLKitFaceDetectionContextProvider
toFaceDetectionProvider
- Added comprehensive error handling
- Added new state management with
FaceDetectionState
type
Here's how to update your app:
Using the detector
const options = {
- detectLandmarks: true,
+ landmarkMode: true,
- runClassifications: true,
+ classificationMode: true,
}
Using the provider
- import { RNMLKitFaceDetectionContextProvider } from "@infinitered/react-native-mlkit-face-detection"
+ import { FaceDetectionProvider } from "@infinitered/react-native-mlkit-face-detection"
function App() {
return (
- <RNMLKitFaceDetectionContextProvider>
+ <FaceDetectionProvider>
{/* Rest of your app */}
- </RNMLKitFaceDetectionContextProvider>
+ </FaceDetectionProvider>
)
}
Using the hooks
- const detector = useFaceDetector()
+ const detector = useFaceDetection()
// useFacesInPhoto remains unchanged
const { faces, status, error } = useFacesInPhoto(imageUri)
Minor Changes
- b668ab0: align podspec platform requirements with expo version