Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-native-face-detector-camera
Advanced tools
A React Native front camera face detector module using MLKit
react-native-face-detector-camera
is an Expo module that uses device's front camera and MLKit to detect faces in real-time and visualize the detected face on the screen.
If this package helped you please give it a ⭐ on GitHub.
This package was created to meet a private project's need. New features are unlikely to be added. Bug fixes will be prioritized for those impacting project stability.
Knowing this, you're free to use this package as it is.
yarn add react-native-face-detector-camera
You can configure react-native-face-detector-camera
using built-in config plugin. This plugin allows you to change camera permission message that cannot be set at runtime and require you to build a new binary to take effect.
Example:
{
"expo": {
...,
"plugins": [
["react-native-face-detector-camera",{
"cameraPermission": "Allow $(PRODUCT_NAME) to access your camera"
}]
]
}
}
import {
useEffect,
useRef
} from 'react'
import {
StyleSheet,
View
} from 'react-native'
import {
CameraView,
useCameraPermissions,
FaceDetectorMode,
FaceDetectorClassifications,
FaceDetectionResult
} from 'react-native-face-detector-camera'
function App() {
const [
status,
requestPermission
] = useCameraPermissions()
const camera = useRef<CameraView>( null )
useEffect( () => {
( async () => {
if ( status?.granted ) return
await requestPermission()
} )()
}, [ status ] )
function processFaceDetection( {
faces
}: FaceDetectionResult ) {
console.log( 'faces', faces )
if ( faces.length <= 0 ) return
const {
size,
origin
} = faces[ 0 ].bounds
// handle face position on screen
if(
// size.width|height >= ...
// size.width|height <= ...
// origin.x >= ...
// origin.x <= ...
// origin.y >= ...
// origin.y <= ...
) {
handleTakePicture()
}
}
function handleTakePicture() {
if ( !camera.current ) {
console.log( 'camera ref is not valid' )
return
}
camera.current.takePictureAsync( {
skipProcessing: true,
onPictureSaved: ( async ( {
uri
} ) => {
console.log( 'picture saved event', uri )
} )
} )
}
return (
<View
style={ StyleSheet.absoluteFill }
>
<CameraView
ref={ camera }
style={ StyleSheet.absoluteFill }
facing={ 'front' }
onCameraReady={ () => { console.log( 'camera is ready' ) } }
onMountError={ () => { console.log( 'camera mount error' ) } }
faceDetectorSettings={ {
mode: FaceDetectorMode.fast,
runClassifications: FaceDetectorClassifications.all,
minDetectionInterval: 200
} }
onFacesDetected={ processFaceDetection }
/>
</View>
)
}
Min Android/IOS versions:
Android SDK
: 26
(Android 8)IOS
: 13.4
Made with ❤️ by nonam4
FAQs
A React Native front camera face detector module using MLKit
The npm package react-native-face-detector-camera receives a total of 13 weekly downloads. As such, react-native-face-detector-camera popularity was classified as not popular.
We found that react-native-face-detector-camera demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.