vision-camera-realtime-object-detection icon indicating copy to clipboard operation
vision-camera-realtime-object-detection copied to clipboard

the detectObjects function is not working for me

Open fazzysyed opened this issue 1 year ago • 3 comments

const frameProcessor = useFrameProcessor(frame => { 'worklet';

const detectedObjects = detectObjects(frame, frameProcessorConfig);

//nothing happens console.log(detectObjects);

runOnJS(setObjects)(
  detectedObjects.map(obj => ({
    ...obj,
    top: obj.top * windowDimensions.height,
    left: obj.left * windowDimensions.width,
    width: obj.width * windowDimensions.width,
    height: obj.height * windowDimensions.height,
  })),
);

}, []);

"react-native-reanimated": "3.5.0",
"react-native-vision-camera": "^2.15.4",
"vision-camera-realtime-object-detection" :"0.5.1" 


if a use react-native-reanimated 2.10.4 
I get the frame is disabled because react native reanimated 3.5.0 is not installed

fazzysyed avatar Nov 16 '23 12:11 fazzysyed

I am also having this issue where detectObjects is undefined

nys99 avatar Dec 21 '23 22:12 nys99

@fazzysyed @nys99 Hi guys! Have you seen this thread? https://github.com/jaroslawkrol/vision-camera-realtime-object-detection/issues/7

First of all try to use model used here

jaroslawkrol avatar Dec 22 '23 20:12 jaroslawkrol

@fazzysyed @nys99 Hi guys! Have you seen this thread? #7

First of all try to use model used here

Hi @jaroslawkrol thank you for the response and Happy New Year! I came across that thread and used the model that was mentioned there and that works for me!

However, It seems like I am having a similar issue with my model that it does not include metadata, however my error message is slightly different:

java.lang.RuntimeException: Error occurred when initializing ObjectDetector: Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images.

Is the solution to add metadata to add metadata to the model?

nys99 avatar Jan 03 '24 21:01 nys99