-
Notifications
You must be signed in to change notification settings - Fork 102
Big sizes of camera resolution can cause slow capture. #183
Comments
@nh9k, I can look at it, but please post a link to a Snack that reproduces the issue |
@nh9k, that's expected because it needs to copy more data from the camera pixel buffer into a tensor. Is there a model that uses a tensor shape this big? |
Alright @raedle , it's expected more time for copying more data, but it is different with package |
The demo in the object detection tutorial runs inference on the input image (not just taking a photo, the larger the image the longer the pre-processing or inference). Is that done as well in the comparison to I created a simple camera-only example with the target resolution set to PlayTorch Snack: https://snack.playtorch.dev/@raedle/image-capture-example import * as React from 'react';
import { Alert, SafeAreaView, StyleSheet } from 'react-native';
import { Camera } from 'react-native-pytorch-core';
import type { Image } from 'react-native-pytorch-core';
export default function App() {
function handleCapture(image: Image) {
Alert.alert(
`Captured image with size w=${image.getWidth()}, h=${image.getHeight()}`
);
}
return (
<SafeAreaView style={StyleSheet.absoluteFill}>
<Camera
style={StyleSheet.absoluteFill}
onCapture={handleCapture}
targetResolution={{ width: 3000, height: 4000 }}
/>
</SafeAreaView>
);
} RPReplay_Final1675160982.mov |
Thank you, @raedle! |
@raedle, How can i improve the changing speed? I have no idea.. |
Area Select
react-native-pytorch-core (core package)
Description
Hello, always thanks for contributions.
My test app needs an image with good resolution, but if the camera resolution size is larger than that of the playtorch tutorial, it will be slower than before to change the camera screen to the loading screen after pressing the capture button.
I also tested it in the tutorial on android. i modified
targetResolution={{ width: 1080, height: 1920 }}
totargetResolution={{ width: 3000, height: 4000 }}
.The image result is good in resolution, but the loading screen changes slowly on the camera screen.
How can i improve the changing speed?
I saw the code in CamerView.tsx, but it doesn't seem to help me.
The text was updated successfully, but these errors were encountered: