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

runModelOnImage returning Empty array #173

Open
bansalarnav opened this issue Nov 9, 2020 · 1 comment
Open

runModelOnImage returning Empty array #173

bansalarnav opened this issue Nov 9, 2020 · 1 comment

Comments

@bansalarnav
Copy link

Hi,
When i try to run a model it returns an empty array for some reason. The model works on testing in python. Below is my code-

 String res = await Tflite.loadModel(
            model: "models/model.tflite",
            labels: "models/model.txt",
            numThreads: 1, // defaults to 1
            isAsset:
                true, // defaults to true, set to false to load resources outside assets
            useGpuDelegate:
                false // defaults to false, set to true to use GPU delegate
            );

        var recognitions = await Tflite.runModelOnImage(
          path: resizedImage.path, // required
          imageMean: 0.0, // defaults to 117.0
          imageStd: 255.0,
        );
        print(recognitions.toString());
        await Tflite.close();

Would appreciate any help provided

@syeds-git
Copy link

Although I am not sure what the parameters to runModelOnImage do, but in the example for image classification following values are specified:

            imageMean: 0.0,   // defaults to 117.0 
            imageStd: 255.0,  // defaults to 1.0 
            numResults: 2,    // defaults to 5
            threshold: 0.2,   // defaults to 0.1

So try with the above and see if it makes a difference. With the above, I am getting back some results when I run the model in debug mode but not in release mode ( #171 ) where it throws some exceptions.

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

No branches or pull requests

2 participants