ImFusion C++ SDK 4.5.0
ImFusion::MonocularDepthEstimationDepthAnything Class Reference

#include <ImFusion/Vision/MonocularDepthEstimationDepthAnything.h>

Monocular relative depth estimation using the Depth Anything V2 Small neural network. More...

Inheritance diagram for ImFusion::MonocularDepthEstimationDepthAnything:

Detailed Description

Monocular relative depth estimation using the Depth Anything V2 Small neural network.

This backend wraps a preconfigured Torch FP32 model (DepthAnythingV2-fp32-torch.yaml) registered through VisionMLModelsFactory. Given a single RGB frame, it runs one forward pass and returns a floating-point depth map aligned with the input image (same spacing and pixel-to-world matrix). Depth values are relative, not metric.

Input requirements enforced in compute(): exactly one 2D slice, three channels (RGB), and image modality. ML backend selection and autocast options are exposed via the nested "ML model types" property group from the internal model factory.

Public Member Functions

std::string name () const override
 Returns the display name "Depth Anything V2 Small".
void configure (const Properties *p) override
 Apply configuration, including ML backend settings under "ML model types".
void configuration (Properties *p) const override
 Export current configuration, including ML backend settings under "ML model types".
std::unique_ptr< SharedImagecompute (std::shared_ptr< SharedImage > img) override
 Run depth inference on img.
Public Member Functions inherited from ImFusion::Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 Configurable (const Configurable &rhs)
 Configurable (Configurable &&rhs) noexcept
Configurable & operator= (const Configurable &)
Configurable & operator= (Configurable &&) noexcept

Additional Inherited Members

Public Attributes inherited from ImFusion::Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Member Function Documentation

◆ name()

std::string ImFusion::MonocularDepthEstimationDepthAnything::name ( ) const
inlineoverridevirtual

Returns the display name "Depth Anything V2 Small".

Implements ImFusion::MonocularDepthEstimation.

◆ configure()

void ImFusion::MonocularDepthEstimationDepthAnything::configure ( const Properties * p)
overridevirtual

Apply configuration, including ML backend settings under "ML model types".

Reimplemented from ImFusion::Configurable.

◆ configuration()

void ImFusion::MonocularDepthEstimationDepthAnything::configuration ( Properties * p) const
overridevirtual

Export current configuration, including ML backend settings under "ML model types".

Reimplemented from ImFusion::Configurable.

◆ compute()

std::unique_ptr< SharedImage > ImFusion::MonocularDepthEstimationDepthAnything::compute ( std::shared_ptr< SharedImage > img)
overridevirtual

Run depth inference on img.

Parameters
imgInput RGB image (one slice, three channels).
Returns
New single-channel floating-point SharedImage on success; nullptr if the model is unavailable, the input format is invalid, or prediction fails.

Implements ImFusion::MonocularDepthEstimation.


The documentation for this class was generated from the following file:
  • ImFusion/Vision/MonocularDepthEstimationDepthAnything.h
Search Tab / S to search, Esc to close