EyeAI
Loading...
Searching...
No Matches
DepthModel Class Reference

A utility class for running depth estimation models like MiDaS. More...

#include <DepthModel.hpp>

Public Types

using RunResult
 
using RunRawResult
 

Public Member Functions

 DepthModel (std::unique_ptr< TfLiteRuntime > &&runtime)
 see DepthModel::create
 
 DepthModel (DepthModel &&)=default
 
DepthModeloperator= (DepthModel &&)=default
 
 DepthModel (const DepthModel &)=delete
 
DepthModeloperator= (const DepthModel &)=delete
 
 ~DepthModel ()=default
 
RunResult run (FloatTensorBuffer< FloatTensorFormat::ImageRGB255 > &input)
 
RunRawResult run_raw (FloatTensorBuffer< FloatTensorFormat::ImageRGB255 > &input)
 
std::span< const int > get_input_shape () const
 
std::span< const int > get_output_shape () const
 

Static Public Member Functions

static tl::expected< std::unique_ptr< DepthModel >, TfLiteCreateRuntimeError > create (std::vector< int8_t > &&model_data, std::string_view gpu_delegate_serialization_dir, std::string_view model_token, TfLiteLogWarningCallback log_warning_callback, TfLiteLogErrorCallback log_error_callback, bool enable_npu, std::string npu_skel_directory)
 

Detailed Description

A utility class for running depth estimation models like MiDaS.

Member Typedef Documentation

◆ RunRawResult

Initial value:
tl::expected<
TfLiteRunInferenceError>
TensorBuffer< float, FloatTensorFormat, FORMAT > FloatTensorBuffer
Definition TensorBuffer.hpp:106

◆ RunResult

Initial value:
tl::expected<
TfLiteRunInferenceError>

Constructor & Destructor Documentation

◆ DepthModel() [1/3]

DepthModel::DepthModel ( std::unique_ptr< TfLiteRuntime > && runtime)
inline

◆ DepthModel() [2/3]

DepthModel::DepthModel ( DepthModel && )
default

◆ DepthModel() [3/3]

DepthModel::DepthModel ( const DepthModel & )
delete

◆ ~DepthModel()

DepthModel::~DepthModel ( )
default

Member Function Documentation

◆ create()

tl::expected< std::unique_ptr< DepthModel >, TfLiteCreateRuntimeError > DepthModel::create ( std::vector< int8_t > && model_data,
std::string_view gpu_delegate_serialization_dir,
std::string_view model_token,
TfLiteLogWarningCallback log_warning_callback,
TfLiteLogErrorCallback log_error_callback,
bool enable_npu,
std::string npu_skel_directory )
staticnodiscard

◆ get_input_shape()

std::span< const int > DepthModel::get_input_shape ( ) const
nodiscard

◆ get_output_shape()

std::span< const int > DepthModel::get_output_shape ( ) const
nodiscard

◆ operator=() [1/2]

DepthModel & DepthModel::operator= ( const DepthModel & )
delete

◆ operator=() [2/2]

DepthModel & DepthModel::operator= ( DepthModel && )
default

◆ run()

Parameters
inputshould have 3 * width * height elements.

◆ run_raw()

DepthModel::RunRawResult DepthModel::run_raw ( FloatTensorBuffer< FloatTensorFormat::ImageRGB255 > & input)
nodiscard
Parameters
inputshould have 3 * width * height elements.