Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Object Detection] Documentation is off #165

Open
jolo-dev opened this issue Aug 15, 2024 · 3 comments · May be fixed by #166
Open

[Object Detection] Documentation is off #165

jolo-dev opened this issue Aug 15, 2024 · 3 comments · May be fixed by #166

Comments

@jolo-dev
Copy link

jolo-dev commented Aug 15, 2024

I took the example from the docs here and noticed many errors which I cannot make work :/

MLKitObjectDetection.wrong.types.mp4
@frankcalise frankcalise linked a pull request Aug 15, 2024 that will close this issue
@frankcalise
Copy link
Collaborator

hey @jolo-dev can you try switching that item that isn't found to RNMLKitObjectDetectionObject and the hook should just return the model directly, not an object.

You can use the Example App for reference.

@jolo-dev
Copy link
Author

Hi @frankcalise,

Thanks for commenting. I adjusted the code accordingly.

Now, I get following error when I want to use the ObjectDetectionModelContextProvider.

 ERROR  Error: Cannot find native module 'RNMLKitObjectDetection', js engine: hermes
    at ContextNavigator

I am on expo SDK 51. My client has version 2.31.2

Here my very simplified code

import React from 'react';
import { View, Button, Text } from 'react-native';
import {
  useObjectDetectionModels,
} from "@infinitered/react-native-mlkit-object-detection";

export function CameraScreen() {
  const { ObjectDetectionModelContextProvider } = useObjectDetectionModels({
    loadDefaultModel: true,
    defaultModelOptions: {
      shouldEnableMultipleObjects: true,
      shouldEnableClassification: true,
      detectorMode: "stream",
    },
  });
  return (
    <View style={styles.container}>
        <ObjectDetectionModelContextProvider>
            <MyComponent />
        </ObjectDetectionModelContextProvider>
    </View>
  );
}

@jolo-dev
Copy link
Author

Ah and I am using Android.

Could it be it happens because it was not defined here correctly.
It says RNMLKitObjDet instead of RNMLKitObjectDetection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants