Function: useDepthEstimator()
useDepthEstimator(
config,options?):object
Defined in: hooks/useDepthEstimator.ts:25
React hook to load and run a depth estimation 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 createDepthEstimator.
Parameters
config
The depth estimation model configuration. See DepthEstimatorModel.
options?
Load and caching options. See ResourceOptions.
Returns
object
The same object as DepthEstimator (without dispose),
combined with loading state and download progress.
downloadProgress
downloadProgress:
any
error
error:
any
estimateDepth
estimateDepth:
any=model.estimateDepth
estimateDepthWorklet
estimateDepthWorklet:
any=model.estimateDepthWorklet
isReady
isReady:
boolean=!!model
resource
resource:
any