Skip to content

@infinitered/react-native-mlkit-face-detection@3.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 07 Feb 23:01
3b07ad6

Major Changes

Face Detection

  • Changed option naming conventions to match ML Kit SDK patterns:
  • detectLandmarkslandmarkMode
  • runClassificationsclassificationMode
  • Changed default performanceMode from accurate to fast
  • Renamed hook from useFaceDetector to useFaceDetection
  • Renamed context provider from RNMLKitFaceDetectionContextProvider to FaceDetectionProvider
  • 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

Patch Changes

  • Updated dependencies [b668ab0]
  • Updated dependencies [83b7e6e]
  • Updated dependencies [b668ab0]
  • Updated dependencies [213f085]
  • @infinitered/react-native-mlkit-core@3.0.0