Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to use react-native-camera for realtime pose detection?

$
0
0

I have been trying to use react-native camera to capture an image. This image is given as input into a posenet-model. The detected pose is supposed to be drawn on the canvas.

const takePicture = async () => {    if (cameraRef !== null) {        const options = {quality: 0.5, base64: true}        const data = await cameraRef.current!.takePictureAsync(options)    }}takePicture()return (<View style={screenStyle}><RNCamera            ref={cameraRef}            style={cameraStyle as ViewStyle}            type={RNCamera.Constants.Type.back}            flashMode={RNCamera.Constants.FlashMode.auto}        /><View style={{ flex: 0, flexDirection: 'row', justifyContent: 'center' }}><TouchableOpacity onPress={takePicture} ><Text style={{ fontSize: 14 }}> SNAP </Text></TouchableOpacity></View></View>);

I wanted to know if there is a better way of using the camera to extract frames and process it into the model. Can you help me figure out the logic behind this.

Thank You


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>