You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run my custom model as described in the docs, by defining the model name as part of the options passed to the hook that creates the provider:
constMODELS: AssetRecord={// the name you'll use to refer to the modelmyCustomModel: {// <--- this is the name referenced later// the relative path to the model fileasset: require("./assets/models/my-custom-model.tflite"),options: {// the options you want to use for this modelshouldEnableMultipleObjects: false,shouldEnableClassification: false,detectorMode: "singleImage",},},};
And then:
fetch the model from the hook, if you don't pass a model name it will fetch the default MLKit Object Detection model const { model } = useObjectDetector("myCustomModel");
I have also tried editing the Example app from useObjectDetector("myCustomModel"); to match the name of the custom model to : useObjectDetector("licensePlate");. Unfortunately, no images are detected, even if I take a picture of one of the ExampleApp license plate photos.
I tried copying the model file to my own project assets/models/license-plate-detection.tflite" and it unfortunately does not return any results from this model:
if I try to load the custom model with useObjectDetector("default") nothing ever resolves and I am stuck in loading state, so I must use the name as suggested in the docs.
So I am confused:
Does a custom model work with this library?
What is the naming convention needed for custom model references?
The text was updated successfully, but these errors were encountered:
lucksp
changed the title
Custom model docs v example confusion
Custom model does not work
Nov 21, 2024
I am trying to run my custom model as described in the docs, by defining the model name as part of the options passed to the hook that creates the provider:
And then:
I have also tried editing the Example app from
useObjectDetector("myCustomModel");
to match the name of the custom model to :useObjectDetector("licensePlate");
. Unfortunately, no images are detected, even if I take a picture of one of the ExampleApp license plate photos.However, in the
ExampleApp
with the license plate detection, theuseObjectDetector
argument does not match:useObjectDetector("default")
I tried copying the model file to my own project
assets/models/license-plate-detection.tflite"
and it unfortunately does not return any results from this model:if I try to load the custom model with
useObjectDetector("default")
nothing ever resolves and I am stuck in loading state, so I must use the name as suggested in the docs.So I am confused:
The text was updated successfully, but these errors were encountered: