Function: useInstanceSegmenter()
useInstanceSegmenter<
F,L>(config,options?):object
Defined in: hooks/useInstanceSegmenter.ts:28
React hook to load and run an instance segmentation model.
This hook manages downloading (if remote URLs are provided) and loading the model assets, compiling them, tracking download progress and load errors, and releasing native memory when the component unmounts or the configuration changes.
For imperative usage, see createInstanceSegmenter.
Type Parameters
F
F extends "xyxy" | "xywh" | "cxcywh"
The bounding box format.
L
L
The class labels type.
Parameters
config
InstanceSegmenterModel<F, L>
The instance segmentation model configuration. See InstanceSegmenterModel.
options?
Load and caching options. See ResourceOptions.
Returns
object
The same object as InstanceSegmenter (without dispose),
combined with loading state, download progress, and labels.
downloadProgress
downloadProgress:
any
error
error:
any
isReady
isReady:
boolean=!!model
labels
labels: readonly
L[] =config.modelOpts.labels
resource
resource:
any
segmentInstances
segmentInstances:
any=model.segmentInstances
segmentInstancesWorklet
segmentInstancesWorklet:
any=model.segmentInstancesWorklet