nndeploy C++ API  0.2.0
nndeploy C++ API
Classes | Typedefs | Enumerations | Functions
nndeploy::base Namespace Reference

Classes

class  AutoTime
 
class  BaseLoader
 
struct  bfp16_struct
 
union  cvt_32b
 
struct  DataType
 
struct  Deleter
 
struct  DeviceType
 
class  FileLoader
 
struct  Handle
 
class  Maybe
 
class  MemoryLoader
 
class  Movable
 
class  NonCopyable
 
class  Param
 
class  Point
 Template class for 2D points specified by its coordinates x_ an y_. An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is also a cast operator to convert point coordinates to the specified type. The conversion from floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion uses this operation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented: More...
 
class  Point3
 Template class for 3D points specified by its coordinates x_, y_ and z_. More...
 
class  Range
 Template class specifying a continuous subsequence (slice) of a sequence. The class is used to specify a row or a column span in a matrix ( Mat ) and for many other purposes. Range(a,b) is basically the same as a:b in Matlab or a..b in Python. As in Python, start_ is an inclusive left boundary of the range and end_ is an exclusive right boundary of the range. Such a half-opened interval is usually denoted as $[start_,end_)$ . The static method Range::all() returns a special variable that means "the whole sequence" or "the whole range", just like " : " in Matlab or " ... " in Python. All the methods and functions in OpenCV that take Range support this special Range::all() value. But, of course, in case of your own custom processing, you will probably have to check and handle it explicitly: More...
 
class  Rect
 Template class for 2D rectangles described by the following parameters: More...
 
class  RingQueue
 
class  Scalar
 Template class for a 4-element vector. Scalar_ and Scalar can be used just as typical 4-element vectors. The type Scalar is widely used in OpenCV to pass pixel values. More...
 
class  Singleton
 
class  Size
 Template class for specifying the size of an image or rectangle. The class includes two members called width_ and height_. The structure can be converted to and from the old OpenCV structures CvSize and CvSize2D32f . The same set of arithmetic and comparison operations as for Point is available. More...
 
class  Status
 
class  TimeProfiler
 
class  Timer
 

Typedefs

typedef struct nndeploy::base::bfp16_struct bfp16_t
 
using IntVector = std::vector< int >
 
typedef Point< double > Point2d
 
typedef Point< float > Point2f
 
typedef Point< int > Point2i
 
typedef Point3< double > Point3d
 
typedef Point3< float > Point3f
 
typedef Point3< int > Point3i
 
typedef Rect< double > Rect2d
 
typedef Rect< float > Rect2f
 
typedef Rect< int > Rect2i
 
typedef Scalar< double > Scalar2d
 
typedef Scalar< float > Scalar2f
 
typedef Scalar< int > Scalar2i
 
using ShapeMap = std::map< std::string, std::vector< int > >
 
typedef Size< double > Size2d
 
typedef Size< float > Size2f
 
typedef Size< int > Size2i
 
using SizeVector = std::vector< size_t >
 
template<typename T >
using UniquePtr = std::unique_ptr< T, Deleter >
 

Enumerations

enum  BorderType : int { kBorderTypeConstant = 0x00 , kBorderTypeReflect , kBorderTypeEdge , kBorderTypeNotSupport }
 
enum  CodecFlag : int {
  kCodecFlagImage = 0x0000 , kCodecFlagImages , kCodecFlagVideo , kCodecFlagCamera ,
  kCodecFlagOther
}
 
enum  CodecType : int { kCodecTypeNone = 0x0000 , kCodecTypeOpenCV , kCodecTypeFFmpeg , kCodecTypeStb }
 
enum  CvtColorType : int {
  kCvtColorTypeRGB2GRAY = 0x0000 , kCvtColorTypeBGR2GRAY , kCvtColorTypeRGBA2GRAY , kCvtColorTypeBGRA2GRAY ,
  kCvtColorTypeGRAY2RGB , kCvtColorTypeBGR2RGB , kCvtColorTypeRGBA2RGB , kCvtColorTypeBGRA2RGB ,
  kCvtColorTypeGRAY2BGR , kCvtColorTypeRGB2BGR , kCvtColorTypeRGBA2BGR , kCvtColorTypeBGRA2BGR ,
  kCvtColorTypeGRAY2RGBA , kCvtColorTypeRGB2RGBA , kCvtColorTypeBGR2RGBA , kCvtColorTypeBGRA2RGBA ,
  kCvtColorTypeGRAY2BGRA , kCvtColorTypeRGB2BGRA , kCvtColorTypeBGR2BGRA , kCvtColorTypeRGBA2BGRA ,
  kCvtColorTypeNotSupport
}
 
enum  DataFormat : int {
  kDataFormatN = 0x0000 , kDataFormatNC , kDataFormatNCL , kDataFormatS1D ,
  kDataFormatNCHW , kDataFormatNHWC , kDataFormatOIHW , kDataFormatNC4HW ,
  kDataFormatNC8HW , kDataFormatNCDHW , kDataFormatNDHWC , kDataFormatNDCHW ,
  kDataFormatAuto , kDataFormatNotSupport
}
 
enum  DataTypeCode : uint8_t {
  kDataTypeCodeUint = 0x00 , kDataTypeCodeInt , kDataTypeCodeFp , kDataTypeCodeBFp ,
  kDataTypeCodeOpaqueHandle , kDataTypeCodeNotSupport
}
 
enum  DeviceTypeCode : int {
  kDeviceTypeCodeCpu = 0x0000 , kDeviceTypeCodeArm , kDeviceTypeCodeX86 , kDeviceTypeCodeRiscV ,
  kDeviceTypeCodeCuda , kDeviceTypeCodeRocm , kDeviceTypeCodeSyCL , kDeviceTypeCodeOpenCL ,
  kDeviceTypeCodeOpenGL , kDeviceTypeCodeMetal , kDeviceTypeCodeVulkan , kDeviceTypeCodeHexagon ,
  kDeviceTypeCodeMtkVpu , kDeviceTypeCodeAscendCL , kDeviceTypeCodeAppleNpu , kDeviceTypeCodeRkNpu ,
  kDeviceTypeCodeQualcommNpu , kDeviceTypeCodeMtkNpu , kDeviceTypeCodeSophonNpu , kDeviceTypeCodeNotSupport
}
 
enum  EdgeType : int { kEdgeTypeFixed = 0x0001 , kEdgeTypePipeline = 0x0001 << 1 }
 
enum  EdgeUpdateFlag : int { kEdgeUpdateFlagComplete = 0x0001 , kEdgeUpdateFlagTerminate = 0x0001 << 1 , kEdgeUpdateFlagError = 0x0001 << 2 }
 
enum  EncryptType : int { kEncryptTypeNone = 0x0000 , kEncryptTypeBase64 }
 
enum  ForwardOpType : int {
  kForwardOpTypeDefault = 0x0000 , kForwardOpTypeOneDnn , kForwardOpTypeXnnPack , kForwardOpTypeQnnPack ,
  kForwardOpTypeCudnn , kForwardOpTypeAclOp , kForwardOpTypeNotSupport
}
 
enum  InferenceOptLevel : int { kInferenceOptLevel0 = 0x0000 , kInferenceOptLevel1 , kInferenceOptLevelAuto }
 
enum  InferenceType : int {
  kInferenceTypeNone = 0x0000 , kInferenceTypeDefault , kInferenceTypeOpenVino , kInferenceTypeTensorRt ,
  kInferenceTypeCoreML , kInferenceTypeTfLite , kInferenceTypeOnnxRuntime , kInferenceTypeAscendCL ,
  kInferenceTypeNcnn , kInferenceTypeTnn , kInferenceTypeMnn , kInferenceTypePaddleLite ,
  kInferenceTypeRknn , kInferenceTypeTvm , kInferenceTypeAITemplate , kInferenceTypeSnpe ,
  kInferenceTypeQnn , kInferenceTypeSophon , kInferenceTypeTorch , kInferenceTypeTensorFlow ,
  kInferenceTypeNeuroPilot , kInferenceTypeVllm , kInferenceTypeSGLang , kInferenceTypeLmdeploy ,
  kInferenceTypeLlamaCpp , kInferenceTypeLLM , kInferenceTypeXDit , kInferenceTypeOneDiff ,
  kInferenceTypeDiffusers , kInferenceTypeDiff , kInferenceTypeNotSupport
}
 
enum  InterpType : int {
  kInterpTypeNearst = 0x00 , kInterpTypeLinear , kInterpTypeCubic , kInterpTypeArer ,
  kInterpTypeNotSupport
}
 
enum  MemoryPoolType : int { kMemoryPoolTypeEmbed = 0x0000 , kMemoryPoolTypeUnity , kMemoryPoolTypeChunkIndepend }
 
enum  MemoryType : int { kMemoryTypeNone = 0x0000 , kMemoryTypeAllocate , kMemoryTypeExternal , kMemoryTypeMapped }
 
enum  ModelType : int {
  kModelTypeDefault = 0x0000 , kModelTypeOpenVino , kModelTypeTensorRt , kModelTypeCoreML ,
  kModelTypeTfLite , kModelTypeOnnx , kModelTypeAscendCL , kModelTypeNcnn ,
  kModelTypeTnn , kModelTypeMnn , kModelTypePaddleLite , kModelTypeRknn ,
  kModelTypeTvm , kModelTypeAITemplate , kModelTypeSnpe , kModelTypeQnn ,
  kModelTypeSophon , kModelTypeTorchScript , kModelTypeTorchPth , kModelTypeHdf5 ,
  kModelTypeSafetensors , kModelTypeNeuroPilot , kModelTypeGGUF , kModelTypeNotSupport
}
 
enum  NodeColorType : int { kNodeColorWhite = 0x0000 , kNodeColorGray , kNodeColorBlack }
 
enum  ParallelType : int { kParallelTypeNone = 0x0001 , kParallelTypeSequential = 0x0001 << 1 , kParallelTypeTask = 0x0001 << 2 , kParallelTypePipeline = 0x0001 << 3 }
 
enum  PixelType : int {
  kPixelTypeGRAY = 0x0000 , kPixelTypeRGB , kPixelTypeBGR , kPixelTypeRGBA ,
  kPixelTypeBGRA , kPixelTypeNotSupport
}
 
enum  PowerType : int { kPowerTypeHigh = 0x0000 , kPowerTypeNormal , kPowerTypeLow , kPowerTypeNotSupport }
 
enum  PrecisionType : int {
  kPrecisionTypeBFp16 = 0x0000 , kPrecisionTypeFp16 , kPrecisionTypeFp32 , kPrecisionTypeFp64 ,
  kPrecisionTypeNotSupport
}
 
enum  QueueOverflowPolicy : int { kQueueOverflowPolicyNodeBackpressure = 0x0001 , kQueueOverflowPolicyAllBackpressure = 0x0001 << 1 , kQueueOverflowPolicyDropOldest = 0x0001 << 2 }
 
enum  ShareMemoryType : int { kShareMemoryTypeNoShare = 0x0000 , kShareMemoryTypeShareFromExternal , kShareMemoryTypeNotSupport }
 
enum  StatusCode : int {
  kStatusCodeOk = 0x0000 , kStatusCodeErrorUnknown , kStatusCodeErrorOutOfMemory , kStatusCodeErrorNotSupport ,
  kStatusCodeErrorNotImplement , kStatusCodeErrorInvalidValue , kStatusCodeErrorInvalidParam , kStatusCodeErrorNullParam ,
  kStatusCodeErrorThreadPool , kStatusCodeErrorIO , kStatusCodeErrorDeviceCpu , kStatusCodeErrorDeviceArm ,
  kStatusCodeErrorDeviceX86 , kStatusCodeErrorDeviceRiscV , kStatusCodeErrorDeviceCuda , kStatusCodeErrorDeviceRocm ,
  kStatusCodeErrorDeviceSyCL , kStatusCodeErrorDeviceOpenCL , kStatusCodeErrorDeviceOpenGL , kStatusCodeErrorDeviceMetal ,
  kStatusCodeErrorDeviceVulkan , kStatusCodeErrorDeviceHexagon , kStatusCodeErrorDeviceMtkVpu , kStatusCodeErrorDeviceAscendCL ,
  kStatusCodeErrorDeviceAppleNpu , kStatusCodeErrorDeviceRkNpu , kStatusCodeErrorDeviceQualcommNpu , kStatusCodeErrorDeviceMtkNpu ,
  kStatusCodeErrorDeviceSophonNpu , kStatusCodeErrorOpAscendCL , kStatusCodeErrorInferenceDefault , kStatusCodeErrorInferenceOpenVino ,
  kStatusCodeErrorInferenceTensorRt , kStatusCodeErrorInferenceCoreML , kStatusCodeErrorInferenceTfLite , kStatusCodeErrorInferenceOnnxRuntime ,
  kStatusCodeErrorInferenceAscendCL , kStatusCodeErrorInferenceNcnn , kStatusCodeErrorInferenceTnn , kStatusCodeErrorInferenceMnn ,
  kStatusCodeErrorInferencePaddleLite , kStatusCodeErrorInferenceRknn , kStatusCodeErrorInferenceTvm , kStatusCodeErrorInferenceAITemplate ,
  kStatusCodeErrorInferenceSnpe , kStatusCodeErrorInferenceQnn , kStatusCodeErrorInferenceSophon , kStatusCodeErrorInferenceTorch ,
  kStatusCodeErrorInferenceTensorFlow , kStatusCodeErrorInferenceNeuroPilot , kStatusCodeErrorInferenceVllm , kStatusCodeErrorInferenceSGLang ,
  kStatusCodeErrorInferenceLmdeploy , kStatusCodeErrorInferenceLlamaCpp , kStatusCodeErrorInferenceLLM , kStatusCodeErrorInferenceXDit ,
  kStatusCodeErrorInferenceOneDiff , kStatusCodeErrorInferenceDiffusers , kStatusCodeErrorInferenceDiff , kStatusCodeErrorInferenceOther ,
  kStatusCodeErrorDag , kStatusCodeNodeInterrupt
}
 
enum  TensorType : int { kTensorTypeDefault = 0x0000 , kTensorTypePipeline }
 
enum  TopoSortType : int { kTopoSortTypeBFS = 0x0000 , kTopoSortTypeDFS }
 

Functions

std::string borderTypeToString (BorderType border_type)
 
void byteSwap (void *data, size_t elem_bytes, size_t num_elems)
 A generic inplace byte swapping function. More...
 
CvtColorType calCvtColorType (PixelType src, PixelType dst)
 
std::string canonicalPath (const std::string &path)
 Converts path p to a canonical absolute path Symlinks are processed if there is support for them on running platform. More...
 
std::string codecFlagToString (CodecFlag src)
 
std::string codecTypeToString (CodecType src)
 
bool convertFromBfp16ToFloat (void *bfp16, float *fp32, int count)
 
bool convertFromFloatToBfp16 (float *fp32, void *bfp16, int count)
 
bool convertFromFloatToFp16 (float *fp32, void *fp16, int count)
 
bool convertFromFp16ToFloat (void *fp16, float *fp32, int count)
 
bool createDirectories (const std::string &path_param)
 
bool createDirectory (const std::string &path)
 
std::string cvtColorTypeToString (CvtColorType cvt_color_type)
 
std::string dataFormatToString (DataFormat data_format)
 
std::string dataTypeCodeToString (DataTypeCode src)
 
template<typename T >
DataType dataTypeOf ()
 
template<>
DataType dataTypeOf< bfp16_t > ()
 
template<>
DataType dataTypeOf< double > ()
 
template<>
DataType dataTypeOf< float > ()
 
template<>
DataType dataTypeOf< half_float::half > ()
 
template<>
DataType dataTypeOf< int16_t > ()
 
template<>
DataType dataTypeOf< int32_t > ()
 
template<>
DataType dataTypeOf< int64_t > ()
 
template<>
DataType dataTypeOf< int8_t > ()
 
template<>
DataType dataTypeOf< uint16_t > ()
 
template<>
DataType dataTypeOf< uint32_t > ()
 
template<>
DataType dataTypeOf< uint64_t > ()
 
template<>
DataType dataTypeOf< uint8_t > ()
 
std::string dataTypeToString (DataType data_type)
 
std::string deviceTypeCodeToString (DeviceTypeCode src)
 
std::string deviceTypeToString (DeviceType src)
 
std::string edgeTypeToString (EdgeType src)
 
std::string edgeUpdateFlagToString (EdgeUpdateFlag src)
 
std::string encryptTypeToString (EncryptType src)
 
bool exists (const std::string &path)
 
std::string forwardOpTypeToString (ForwardOpType src)
 
bool freeLibrary (const std::string &path)
 
std::string getcwd ()
 
HandlegetLibraryHandle (const std::string &path, bool update)
 
std::string getParentPath (const std::string &path)
 
std::wstring getParentPath (const std::wstring &path)
 
PrecisionType getPrecisionType (DataType data_type)
 
std::string getUniqueString ()
 
void glob (const std::string &directory, const std::string &pattern, std::vector< std::string > &result, bool recursive=false, bool include_directories=false)
 
void globRelative (const std::string &directory, const std::string &pattern, std::vector< std::string > &result, bool recursive=false, bool include_directories=false)
 
std::string inferenceOptLevelToString (InferenceOptLevel src)
 
std::string inferenceTypeToString (InferenceType src)
 
std::string interpTypeToString (InterpType interp_type)
 
bool isAlpha (char c)
 Inline implementation of isAlpha(). Tests whether the given character is an alphabet letter. More...
 
bool isBlank (char c)
 Inline implementation of isBlank(). Tests whether the given character is a space or tab character. More...
 
bool isDigit (char c)
 Inline implementation of isDigit(). Tests whether the given character is a decimal digit. More...
 
bool isDigitchars (char c)
 Tests whether the given character is a valid letter in the string representation of a floating-point value, i.e. decimal digits, signs (+/-), decimal point (.), or exponent marker (e/E). More...
 
bool isDirectory (const std::string &path)
 
bool isDynamicShape (const IntVector &dims)
 
bool isNumeric (const std::string &str)
 
bool isPathSeparator (char c)
 
bool isSpace (char c)
 Inline implementation of isSpace(). Tests whether the given character is a whitespace letter. More...
 
std::string joinPath (const std::string &base, const std::string &path)
 
bool loadLibraryFromPath (const std::string &path, bool update)
 
std::string memoryPoolTypeToString (MemoryPoolType src)
 
std::string memoryTypeToString (MemoryType src)
 
std::string modelTypeToString (ModelType src)
 
std::string nodeColorTypeToString (NodeColorType src)
 
template<>
double normL2Sqr< double > (const Point< double > &pt)
 
template<>
double normL2Sqr< double > (const Point< float > &pt)
 
template<>
double normL2Sqr< double > (const Point< int > &pt)
 
template<>
float normL2Sqr< float > (const Point< float > &pt)
 
template<>
int normL2Sqr< int > (const Point< int > &pt)
 
std::string openFile (const std::string &file_path)
 
std::string overflowPolicyToString (QueueOverflowPolicy src)
 
std::string parallelTypeToString (ParallelType src)
 
std::string pixelTypeToString (PixelType pixel_type)
 
std::string powerTypeToString (PowerType src)
 
std::string precisionTypeToString (PrecisionType src)
 
std::string prettyJsonStr (const std::string &json_str)
 
template<typename T >
void printData (T *data, base::IntVector &shape, std::ostream &stream=std::cout)
 
template<typename T >
void printData (T *data, size_t size, std::ostream &stream=std::cout)
 
double rectangleIntersectionArea (const Rect2d &a, const Rect2d &b)
 Finds out if there is any intersection between two rectangles. More...
 
void removeAllFile (const std::string &path)
 
std::string removeJsonBrackets (const std::string &json_str)
 
template<>
int saturate_cast< int > (double v)
 
template<>
int saturate_cast< int > (float v)
 
template<>
int saturate_cast< int > (int64_t v)
 
template<>
int saturate_cast< int > (uint64_t v)
 
template<>
int saturate_cast< int > (unsigned v)
 
template<>
int64_t saturate_cast< int64_t > (uint64_t v)
 
template<>
short saturate_cast< short > (double v)
 
template<>
short saturate_cast< short > (float v)
 
template<>
short saturate_cast< short > (int v)
 
template<>
short saturate_cast< short > (int64_t v)
 
template<>
short saturate_cast< short > (uint64_t v)
 
template<>
short saturate_cast< short > (unsigned short v)
 
template<>
short saturate_cast< short > (unsigned v)
 
template<>
signed char saturate_cast< signed char > (double v)
 
template<>
signed char saturate_cast< signed char > (float v)
 
template<>
signed char saturate_cast< signed char > (int v)
 
template<>
signed char saturate_cast< signed char > (int64_t v)
 
template<>
signed char saturate_cast< signed char > (short v)
 
template<>
signed char saturate_cast< signed char > (uint64_t v)
 
template<>
signed char saturate_cast< signed char > (unsigned char v)
 
template<>
signed char saturate_cast< signed char > (unsigned short v)
 
template<>
signed char saturate_cast< signed char > (unsigned v)
 
template<>
uint64_t saturate_cast< uint64_t > (int v)
 
template<>
uint64_t saturate_cast< uint64_t > (int64_t v)
 
template<>
uint64_t saturate_cast< uint64_t > (short v)
 
template<>
uint64_t saturate_cast< uint64_t > (signed char v)
 
template<>
unsigned saturate_cast< unsigned > (double v)
 
template<>
unsigned saturate_cast< unsigned > (float v)
 
template<>
unsigned saturate_cast< unsigned > (int v)
 
template<>
unsigned saturate_cast< unsigned > (int64_t v)
 
template<>
unsigned saturate_cast< unsigned > (short v)
 
template<>
unsigned saturate_cast< unsigned > (signed char v)
 
template<>
unsigned saturate_cast< unsigned > (uint64_t v)
 
template<>
unsigned char saturate_cast< unsigned char > (double v)
 
template<>
unsigned char saturate_cast< unsigned char > (float v)
 
template<>
unsigned char saturate_cast< unsigned char > (int v)
 
template<>
unsigned char saturate_cast< unsigned char > (int64_t v)
 
template<>
unsigned char saturate_cast< unsigned char > (short v)
 
template<>
unsigned char saturate_cast< unsigned char > (signed char v)
 
template<>
unsigned char saturate_cast< unsigned char > (uint64_t v)
 
template<>
unsigned char saturate_cast< unsigned char > (unsigned short v)
 
template<>
unsigned char saturate_cast< unsigned char > (unsigned v)
 
template<>
unsigned short saturate_cast< unsigned short > (double v)
 
template<>
unsigned short saturate_cast< unsigned short > (float v)
 
template<>
unsigned short saturate_cast< unsigned short > (int v)
 
template<>
unsigned short saturate_cast< unsigned short > (int64_t v)
 
template<>
unsigned short saturate_cast< unsigned short > (short v)
 
template<>
unsigned short saturate_cast< unsigned short > (signed char v)
 
template<>
unsigned short saturate_cast< unsigned short > (uint64_t v)
 
template<>
unsigned short saturate_cast< unsigned short > (unsigned v)
 
size_t shapeCount (const IntVector &dims, int start_index=0, int end_index=-1)
 
bool shapeEqual (const IntVector &dims0, const IntVector &dims1, int start_index=0, int end_index=-1)
 
IntVector shapeMax (const IntVector &dims0, const IntVector &dims1, int start_index=0, int end_index=-1)
 
IntVector shapeMin (const IntVector &dims0, const IntVector &dims1, int start_index=0, int end_index=-1)
 
IntVector shapeNchw2Nhwc (const IntVector &dims)
 
IntVector shapeNhwc2Nchw (const IntVector &dims)
 
std::string shareMemoryTypeToString (ShareMemoryType src)
 
std::vector< std::string > splitString (const std::string &str, const std::string &spstr)
 
std::string statusCodeToString (StatusCode code)
 
BorderType stringToBorderType (const std::string &border_type_str)
 
CodecFlag stringToCodecFlag (const std::string &src)
 
CodecType stringToCodecType (const std::string &src)
 
CvtColorType stringToCvtColorType (const std::string &cvt_color_type_str)
 
DataFormat stringToDataFormat (const std::string &str)
 
DataType stringToDataType (const std::string &str)
 
DataTypeCode stringToDataTypeCode (const std::string &src)
 
DeviceType stringToDeviceType (const std::string &src)
 
DeviceTypeCode stringToDeviceTypeCode (const std::string &src)
 
EdgeType stringToEdgeType (const std::string &src)
 
EdgeUpdateFlag stringToEdgeUpdateFlag (const std::string &src)
 
EncryptType stringToEncryptType (const std::string &src)
 
ForwardOpType stringToForwardOpType (const std::string &src)
 
InferenceOptLevel stringToInferenceOptLevel (const std::string &src)
 
InferenceType stringToInferenceType (const std::string &src)
 
InterpType stringToInterpType (const std::string &interp_type_str)
 
MemoryPoolType stringToMemoryPoolType (const std::string &src)
 
MemoryType stringToMemoryType (const std::string &src)
 
ModelType stringToModelType (const std::string &src)
 
NodeColorType stringToNodeColorType (const std::string &src)
 
QueueOverflowPolicy stringToOverflowPolicy (const std::string &src)
 
ParallelType stringToParallelType (const std::string &src)
 
PixelType stringToPixelType (const std::string &pixel_type_str)
 
PowerType stringToPowerType (const std::string &src)
 
PrecisionType stringToPrecisionType (const std::string &src)
 
ShareMemoryType stringToShareMemoryType (const std::string &src)
 
TensorType stringToTensorType (const std::string &src)
 
TopoSortType stringToTopoSortType (const std::string &src)
 
std::wstring stringToWstring (const std::string &str)
 
std::string tensorTypeToString (TensorType src)
 
void timePointEnd (const std::string &key)
 
void timePointStart (const std::string &key)
 
float timeProfilerGetAverageTime (const std::string &key)
 
float timeProfilerGetCostTime (const std::string &key)
 
void timeProfilerPrint (const std::string &title="")
 
void timeProfilerPrintIndex (const std::string &title, uint64_t index)
 
void timeProfilerPrintRemoveWarmup (const std::string &title, uint64_t warmup_times)
 
void timeProfilerReset ()
 
std::string topoSortTypeToString (TopoSortType src)
 
template<typename T >
std::string toString (T value)
 
std::string ucharToString (const unsigned char *buffer, int length)
 
template<typename T >
std::string vectorToString (std::vector< T > val)
 
std::string wstringToString (const std::wstring &wstr)
 

Typedef Documentation

◆ bfp16_t

◆ IntVector

using nndeploy::base::IntVector = typedef std::vector<int>

Definition at line 379 of file common.h.

◆ Point2d

typedef Point<double> nndeploy::base::Point2d

Definition at line 180 of file type.h.

◆ Point2f

Definition at line 179 of file type.h.

◆ Point2i

Definition at line 178 of file type.h.

◆ Point3d

Definition at line 233 of file type.h.

◆ Point3f

Definition at line 232 of file type.h.

◆ Point3i

Definition at line 231 of file type.h.

◆ Rect2d

typedef Rect<double> nndeploy::base::Rect2d

Definition at line 376 of file type.h.

◆ Rect2f

typedef Rect<float> nndeploy::base::Rect2f

Definition at line 375 of file type.h.

◆ Rect2i

Definition at line 374 of file type.h.

◆ Scalar2d

Definition at line 455 of file type.h.

◆ Scalar2f

Definition at line 454 of file type.h.

◆ Scalar2i

Definition at line 453 of file type.h.

◆ ShapeMap

using nndeploy::base::ShapeMap = typedef std::map<std::string, std::vector<int> >

Definition at line 381 of file common.h.

◆ Size2d

typedef Size<double> nndeploy::base::Size2d

Definition at line 282 of file type.h.

◆ Size2f

typedef Size<float> nndeploy::base::Size2f

Definition at line 281 of file type.h.

◆ Size2i

Definition at line 280 of file type.h.

◆ SizeVector

using nndeploy::base::SizeVector = typedef std::vector<size_t>

Definition at line 380 of file common.h.

◆ UniquePtr

template<typename T >
using nndeploy::base::UniquePtr = typedef std::unique_ptr<T, Deleter>

Definition at line 41 of file object.h.

Enumeration Type Documentation

◆ BorderType

Enumerator
kBorderTypeConstant 
kBorderTypeReflect 
kBorderTypeEdge 
kBorderTypeNotSupport 

Definition at line 70 of file type.h.

◆ CodecFlag

Enumerator
kCodecFlagImage 
kCodecFlagImages 
kCodecFlagVideo 
kCodecFlagCamera 
kCodecFlagOther 

Definition at line 344 of file common.h.

◆ CodecType

Enumerator
kCodecTypeNone 
kCodecTypeOpenCV 
kCodecTypeFFmpeg 
kCodecTypeStb 

Definition at line 337 of file common.h.

◆ CvtColorType

Enumerator
kCvtColorTypeRGB2GRAY 
kCvtColorTypeBGR2GRAY 
kCvtColorTypeRGBA2GRAY 
kCvtColorTypeBGRA2GRAY 
kCvtColorTypeGRAY2RGB 
kCvtColorTypeBGR2RGB 
kCvtColorTypeRGBA2RGB 
kCvtColorTypeBGRA2RGB 
kCvtColorTypeGRAY2BGR 
kCvtColorTypeRGB2BGR 
kCvtColorTypeRGBA2BGR 
kCvtColorTypeBGRA2BGR 
kCvtColorTypeGRAY2RGBA 
kCvtColorTypeRGB2RGBA 
kCvtColorTypeBGR2RGBA 
kCvtColorTypeBGRA2RGBA 
kCvtColorTypeGRAY2BGRA 
kCvtColorTypeRGB2BGRA 
kCvtColorTypeBGR2BGRA 
kCvtColorTypeRGBA2BGRA 
kCvtColorTypeNotSupport 

Definition at line 23 of file type.h.

◆ DataFormat

Enumerator
kDataFormatN 
kDataFormatNC 
kDataFormatNCL 
kDataFormatS1D 
kDataFormatNCHW 
kDataFormatNHWC 
kDataFormatOIHW 
kDataFormatNC4HW 
kDataFormatNC8HW 
kDataFormatNCDHW 
kDataFormatNDHWC 
kDataFormatNDCHW 
kDataFormatAuto 
kDataFormatNotSupport 

Definition at line 130 of file common.h.

◆ DataTypeCode

Enumerator
kDataTypeCodeUint 
kDataTypeCodeInt 
kDataTypeCodeFp 
kDataTypeCodeBFp 
kDataTypeCodeOpaqueHandle 
kDataTypeCodeNotSupport 

Definition at line 13 of file common.h.

◆ DeviceTypeCode

Enumerator
kDeviceTypeCodeCpu 
kDeviceTypeCodeArm 
kDeviceTypeCodeX86 
kDeviceTypeCodeRiscV 
kDeviceTypeCodeCuda 
kDeviceTypeCodeRocm 
kDeviceTypeCodeSyCL 
kDeviceTypeCodeOpenCL 
kDeviceTypeCodeOpenGL 
kDeviceTypeCodeMetal 
kDeviceTypeCodeVulkan 
kDeviceTypeCodeHexagon 
kDeviceTypeCodeMtkVpu 
kDeviceTypeCodeAscendCL 
kDeviceTypeCodeAppleNpu 
kDeviceTypeCodeRkNpu 
kDeviceTypeCodeQualcommNpu 
kDeviceTypeCodeMtkNpu 
kDeviceTypeCodeSophonNpu 
kDeviceTypeCodeNotSupport 

Definition at line 81 of file common.h.

◆ EdgeType

Enumerator
kEdgeTypeFixed 
kEdgeTypePipeline 

Definition at line 360 of file common.h.

◆ EdgeUpdateFlag

Enumerator
kEdgeUpdateFlagComplete 
kEdgeUpdateFlagTerminate 
kEdgeUpdateFlagError 

Definition at line 365 of file common.h.

◆ EncryptType

Enumerator
kEncryptTypeNone 
kEncryptTypeBase64 

Definition at line 332 of file common.h.

◆ ForwardOpType

Enumerator
kForwardOpTypeDefault 
kForwardOpTypeOneDnn 
kForwardOpTypeXnnPack 
kForwardOpTypeQnnPack 
kForwardOpTypeCudnn 
kForwardOpTypeAclOp 
kForwardOpTypeNotSupport 

Definition at line 218 of file common.h.

◆ InferenceOptLevel

Enumerator
kInferenceOptLevel0 
kInferenceOptLevel1 
kInferenceOptLevelAuto 

Definition at line 231 of file common.h.

◆ InferenceType

Enumerator
kInferenceTypeNone 
kInferenceTypeDefault 
kInferenceTypeOpenVino 
kInferenceTypeTensorRt 
kInferenceTypeCoreML 
kInferenceTypeTfLite 
kInferenceTypeOnnxRuntime 
kInferenceTypeAscendCL 
kInferenceTypeNcnn 
kInferenceTypeTnn 
kInferenceTypeMnn 
kInferenceTypePaddleLite 
kInferenceTypeRknn 
kInferenceTypeTvm 
kInferenceTypeAITemplate 
kInferenceTypeSnpe 
kInferenceTypeQnn 
kInferenceTypeSophon 
kInferenceTypeTorch 
kInferenceTypeTensorFlow 
kInferenceTypeNeuroPilot 
kInferenceTypeVllm 
kInferenceTypeSGLang 
kInferenceTypeLmdeploy 
kInferenceTypeLlamaCpp 
kInferenceTypeLLM 
kInferenceTypeXDit 
kInferenceTypeOneDiff 
kInferenceTypeDiffusers 
kInferenceTypeDiff 
kInferenceTypeNotSupport 

Definition at line 284 of file common.h.

◆ InterpType

Enumerator
kInterpTypeNearst 

nearest neighbor interpolation

kInterpTypeLinear 

bilinear interpolation

kInterpTypeCubic 

bicubic interpolation

kInterpTypeArer 

resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire'-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.

kInterpTypeNotSupport 

Definition at line 53 of file type.h.

◆ MemoryPoolType

Enumerator
kMemoryPoolTypeEmbed 
kMemoryPoolTypeUnity 
kMemoryPoolTypeChunkIndepend 

Definition at line 207 of file common.h.

◆ MemoryType

Enumerator
kMemoryTypeNone 
kMemoryTypeAllocate 
kMemoryTypeExternal 
kMemoryTypeMapped 

Definition at line 194 of file common.h.

◆ ModelType

Enumerator
kModelTypeDefault 
kModelTypeOpenVino 
kModelTypeTensorRt 
kModelTypeCoreML 
kModelTypeTfLite 
kModelTypeOnnx 
kModelTypeAscendCL 
kModelTypeNcnn 
kModelTypeTnn 
kModelTypeMnn 
kModelTypePaddleLite 
kModelTypeRknn 
kModelTypeTvm 
kModelTypeAITemplate 
kModelTypeSnpe 
kModelTypeQnn 
kModelTypeSophon 
kModelTypeTorchScript 
kModelTypeTorchPth 
kModelTypeHdf5 
kModelTypeSafetensors 
kModelTypeNeuroPilot 
kModelTypeGGUF 
kModelTypeNotSupport 

Definition at line 239 of file common.h.

◆ NodeColorType

Enumerator
kNodeColorWhite 
kNodeColorGray 
kNodeColorBlack 

Definition at line 371 of file common.h.

◆ ParallelType

Enumerator
kParallelTypeNone 
kParallelTypeSequential 
kParallelTypeTask 
kParallelTypePipeline 

Definition at line 353 of file common.h.

◆ PixelType

Enumerator
kPixelTypeGRAY 
kPixelTypeRGB 
kPixelTypeBGR 
kPixelTypeRGBA 
kPixelTypeBGRA 
kPixelTypeNotSupport 

Definition at line 12 of file type.h.

◆ PowerType

Enumerator
kPowerTypeHigh 
kPowerTypeNormal 
kPowerTypeLow 
kPowerTypeNotSupport 

Definition at line 177 of file common.h.

◆ PrecisionType

Enumerator
kPrecisionTypeBFp16 
kPrecisionTypeFp16 
kPrecisionTypeFp32 
kPrecisionTypeFp64 
kPrecisionTypeNotSupport 

Definition at line 167 of file common.h.

◆ QueueOverflowPolicy

Enumerator
kQueueOverflowPolicyNodeBackpressure 
kQueueOverflowPolicyAllBackpressure 
kQueueOverflowPolicyDropOldest 

Definition at line 201 of file common.h.

◆ ShareMemoryType

Enumerator
kShareMemoryTypeNoShare 
kShareMemoryTypeShareFromExternal 
kShareMemoryTypeNotSupport 

Definition at line 186 of file common.h.

◆ StatusCode

Enumerator
kStatusCodeOk 
kStatusCodeErrorUnknown 
kStatusCodeErrorOutOfMemory 
kStatusCodeErrorNotSupport 
kStatusCodeErrorNotImplement 
kStatusCodeErrorInvalidValue 
kStatusCodeErrorInvalidParam 
kStatusCodeErrorNullParam 
kStatusCodeErrorThreadPool 
kStatusCodeErrorIO 
kStatusCodeErrorDeviceCpu 
kStatusCodeErrorDeviceArm 
kStatusCodeErrorDeviceX86 
kStatusCodeErrorDeviceRiscV 
kStatusCodeErrorDeviceCuda 
kStatusCodeErrorDeviceRocm 
kStatusCodeErrorDeviceSyCL 
kStatusCodeErrorDeviceOpenCL 
kStatusCodeErrorDeviceOpenGL 
kStatusCodeErrorDeviceMetal 
kStatusCodeErrorDeviceVulkan 
kStatusCodeErrorDeviceHexagon 
kStatusCodeErrorDeviceMtkVpu 
kStatusCodeErrorDeviceAscendCL 
kStatusCodeErrorDeviceAppleNpu 
kStatusCodeErrorDeviceRkNpu 
kStatusCodeErrorDeviceQualcommNpu 
kStatusCodeErrorDeviceMtkNpu 
kStatusCodeErrorDeviceSophonNpu 
kStatusCodeErrorOpAscendCL 
kStatusCodeErrorInferenceDefault 
kStatusCodeErrorInferenceOpenVino 
kStatusCodeErrorInferenceTensorRt 
kStatusCodeErrorInferenceCoreML 
kStatusCodeErrorInferenceTfLite 
kStatusCodeErrorInferenceOnnxRuntime 
kStatusCodeErrorInferenceAscendCL 
kStatusCodeErrorInferenceNcnn 
kStatusCodeErrorInferenceTnn 
kStatusCodeErrorInferenceMnn 
kStatusCodeErrorInferencePaddleLite 
kStatusCodeErrorInferenceRknn 
kStatusCodeErrorInferenceTvm 
kStatusCodeErrorInferenceAITemplate 
kStatusCodeErrorInferenceSnpe 
kStatusCodeErrorInferenceQnn 
kStatusCodeErrorInferenceSophon 
kStatusCodeErrorInferenceTorch 
kStatusCodeErrorInferenceTensorFlow 
kStatusCodeErrorInferenceNeuroPilot 
kStatusCodeErrorInferenceVllm 
kStatusCodeErrorInferenceSGLang 
kStatusCodeErrorInferenceLmdeploy 
kStatusCodeErrorInferenceLlamaCpp 
kStatusCodeErrorInferenceLLM 
kStatusCodeErrorInferenceXDit 
kStatusCodeErrorInferenceOneDiff 
kStatusCodeErrorInferenceDiffusers 
kStatusCodeErrorInferenceDiff 
kStatusCodeErrorInferenceOther 
kStatusCodeErrorDag 
kStatusCodeNodeInterrupt 

Definition at line 12 of file status.h.

◆ TensorType

Enumerator
kTensorTypeDefault 
kTensorTypePipeline 

Definition at line 213 of file common.h.

◆ TopoSortType

Enumerator
kTopoSortTypeBFS 
kTopoSortTypeDFS 

Definition at line 377 of file common.h.

Function Documentation

◆ borderTypeToString()

std::string nndeploy::base::borderTypeToString ( BorderType  border_type)

◆ byteSwap()

void nndeploy::base::byteSwap ( void *  data,
size_t  elem_bytes,
size_t  num_elems 
)
inline

A generic inplace byte swapping function.

Parameters
dataThe data pointer.
elem_bytesThe number of bytes of the data elements
num_elemsNumber of elements in the data.
Note
Always try pass in constant elem_bytes to enable compiler optimization

Definition at line 61 of file endian.h.

◆ calCvtColorType()

CvtColorType nndeploy::base::calCvtColorType ( PixelType  src,
PixelType  dst 
)

◆ canonicalPath()

std::string nndeploy::base::canonicalPath ( const std::string &  path)

Converts path p to a canonical absolute path Symlinks are processed if there is support for them on running platform.

Parameters
pathinput path. Target file/directory should exist.

◆ codecFlagToString()

std::string nndeploy::base::codecFlagToString ( CodecFlag  src)

◆ codecTypeToString()

std::string nndeploy::base::codecTypeToString ( CodecType  src)

◆ convertFromBfp16ToFloat()

bool nndeploy::base::convertFromBfp16ToFloat ( void *  bfp16,
float *  fp32,
int  count 
)

◆ convertFromFloatToBfp16()

bool nndeploy::base::convertFromFloatToBfp16 ( float *  fp32,
void *  bfp16,
int  count 
)

◆ convertFromFloatToFp16()

bool nndeploy::base::convertFromFloatToFp16 ( float *  fp32,
void *  fp16,
int  count 
)

◆ convertFromFp16ToFloat()

bool nndeploy::base::convertFromFp16ToFloat ( void *  fp16,
float *  fp32,
int  count 
)

◆ createDirectories()

bool nndeploy::base::createDirectories ( const std::string &  path_param)

◆ createDirectory()

bool nndeploy::base::createDirectory ( const std::string &  path)

◆ cvtColorTypeToString()

std::string nndeploy::base::cvtColorTypeToString ( CvtColorType  cvt_color_type)

◆ dataFormatToString()

std::string nndeploy::base::dataFormatToString ( DataFormat  data_format)

◆ dataTypeCodeToString()

std::string nndeploy::base::dataTypeCodeToString ( DataTypeCode  src)

◆ dataTypeOf()

template<typename T >
DataType nndeploy::base::dataTypeOf ( )

Definition at line 53 of file common.h.

◆ dataTypeOf< bfp16_t >()

◆ dataTypeOf< double >()

template<>
DataType nndeploy::base::dataTypeOf< double > ( )

◆ dataTypeOf< float >()

template<>
DataType nndeploy::base::dataTypeOf< float > ( )

◆ dataTypeOf< half_float::half >()

template<>
DataType nndeploy::base::dataTypeOf< half_float::half > ( )

◆ dataTypeOf< int16_t >()

template<>
DataType nndeploy::base::dataTypeOf< int16_t > ( )

◆ dataTypeOf< int32_t >()

template<>
DataType nndeploy::base::dataTypeOf< int32_t > ( )

◆ dataTypeOf< int64_t >()

template<>
DataType nndeploy::base::dataTypeOf< int64_t > ( )

◆ dataTypeOf< int8_t >()

template<>
DataType nndeploy::base::dataTypeOf< int8_t > ( )

◆ dataTypeOf< uint16_t >()

template<>
DataType nndeploy::base::dataTypeOf< uint16_t > ( )

◆ dataTypeOf< uint32_t >()

template<>
DataType nndeploy::base::dataTypeOf< uint32_t > ( )

◆ dataTypeOf< uint64_t >()

template<>
DataType nndeploy::base::dataTypeOf< uint64_t > ( )

◆ dataTypeOf< uint8_t >()

template<>
DataType nndeploy::base::dataTypeOf< uint8_t > ( )

◆ dataTypeToString()

std::string nndeploy::base::dataTypeToString ( DataType  data_type)

◆ deviceTypeCodeToString()

std::string nndeploy::base::deviceTypeCodeToString ( DeviceTypeCode  src)

◆ deviceTypeToString()

std::string nndeploy::base::deviceTypeToString ( DeviceType  src)

◆ edgeTypeToString()

std::string nndeploy::base::edgeTypeToString ( EdgeType  src)

◆ edgeUpdateFlagToString()

std::string nndeploy::base::edgeUpdateFlagToString ( EdgeUpdateFlag  src)

◆ encryptTypeToString()

std::string nndeploy::base::encryptTypeToString ( EncryptType  src)

◆ exists()

bool nndeploy::base::exists ( const std::string &  path)

◆ forwardOpTypeToString()

std::string nndeploy::base::forwardOpTypeToString ( ForwardOpType  src)

◆ freeLibrary()

bool nndeploy::base::freeLibrary ( const std::string &  path)

◆ getcwd()

std::string nndeploy::base::getcwd ( )

◆ getLibraryHandle()

Handle* nndeploy::base::getLibraryHandle ( const std::string &  path,
bool  update 
)

◆ getParentPath() [1/2]

std::string nndeploy::base::getParentPath ( const std::string &  path)

Get parent directory

◆ getParentPath() [2/2]

std::wstring nndeploy::base::getParentPath ( const std::wstring &  path)

◆ getPrecisionType()

PrecisionType nndeploy::base::getPrecisionType ( DataType  data_type)

◆ getUniqueString()

std::string nndeploy::base::getUniqueString ( )

◆ glob()

void nndeploy::base::glob ( const std::string &  directory,
const std::string &  pattern,
std::vector< std::string > &  result,
bool  recursive = false,
bool  include_directories = false 
)

Generate a list of all files that match the globbing pattern.

Result entries are prefixed by base directory path.

Parameters
directorybase directory
patternfilter pattern (based on '*'/'?' symbols). Use empty string to disable filtering and return all results
[out]resultresult of globing.
recursivescan nested directories too
include_directoriesinclude directories into results list

◆ globRelative()

void nndeploy::base::globRelative ( const std::string &  directory,
const std::string &  pattern,
std::vector< std::string > &  result,
bool  recursive = false,
bool  include_directories = false 
)

Generate a list of all files that match the globbing pattern.

Parameters
directorybase directory
patternfilter pattern (based on '*'/'?' symbols). Use empty string to disable filtering and return all results
[out]resultglobbing result with relative paths from base directory
recursivescan nested directories too
include_directoriesinclude directories into results list

◆ inferenceOptLevelToString()

std::string nndeploy::base::inferenceOptLevelToString ( InferenceOptLevel  src)

◆ inferenceTypeToString()

std::string nndeploy::base::inferenceTypeToString ( InferenceType  src)

◆ interpTypeToString()

std::string nndeploy::base::interpTypeToString ( InterpType  interp_type)

◆ isAlpha()

bool nndeploy::base::isAlpha ( char  c)
inline

Inline implementation of isAlpha(). Tests whether the given character is an alphabet letter.

Parameters
cCharacter to test
Returns
Result of the test

Definition at line 79 of file string.h.

◆ isBlank()

bool nndeploy::base::isBlank ( char  c)
inline

Inline implementation of isBlank(). Tests whether the given character is a space or tab character.

Parameters
cCharacter to test
Returns
Result of the test

Definition at line 63 of file string.h.

◆ isDigit()

bool nndeploy::base::isDigit ( char  c)
inline

Inline implementation of isDigit(). Tests whether the given character is a decimal digit.

Parameters
cCharacter to test
Returns
Result of the test

Definition at line 71 of file string.h.

◆ isDigitchars()

bool nndeploy::base::isDigitchars ( char  c)
inline

Tests whether the given character is a valid letter in the string representation of a floating-point value, i.e. decimal digits, signs (+/-), decimal point (.), or exponent marker (e/E).

Parameters
cCharacter to test
Returns
Result of the test

Definition at line 93 of file string.h.

◆ isDirectory()

bool nndeploy::base::isDirectory ( const std::string &  path)

◆ isDynamicShape()

bool nndeploy::base::isDynamicShape ( const IntVector dims)

◆ isNumeric()

bool nndeploy::base::isNumeric ( const std::string &  str)

◆ isPathSeparator()

bool nndeploy::base::isPathSeparator ( char  c)

◆ isSpace()

bool nndeploy::base::isSpace ( char  c)
inline

Inline implementation of isSpace(). Tests whether the given character is a whitespace letter.

Parameters
cCharacter to test
Returns
Result of the test

Definition at line 53 of file string.h.

◆ joinPath()

std::string nndeploy::base::joinPath ( const std::string &  base,
const std::string &  path 
)

Join path components

◆ loadLibraryFromPath()

bool nndeploy::base::loadLibraryFromPath ( const std::string &  path,
bool  update 
)

◆ memoryPoolTypeToString()

std::string nndeploy::base::memoryPoolTypeToString ( MemoryPoolType  src)

◆ memoryTypeToString()

std::string nndeploy::base::memoryTypeToString ( MemoryType  src)

◆ modelTypeToString()

std::string nndeploy::base::modelTypeToString ( ModelType  src)

◆ nodeColorTypeToString()

std::string nndeploy::base::nodeColorTypeToString ( NodeColorType  src)

◆ normL2Sqr< double >() [1/3]

template<>
double nndeploy::base::normL2Sqr< double > ( const Point< double > &  pt)
inline

Definition at line 666 of file type.h.

Here is the call graph for this function:

◆ normL2Sqr< double >() [2/3]

template<>
double nndeploy::base::normL2Sqr< double > ( const Point< float > &  pt)
inline

Definition at line 662 of file type.h.

Here is the call graph for this function:

◆ normL2Sqr< double >() [3/3]

template<>
double nndeploy::base::normL2Sqr< double > ( const Point< int > &  pt)
inline

Definition at line 657 of file type.h.

Here is the call graph for this function:

◆ normL2Sqr< float >()

template<>
float nndeploy::base::normL2Sqr< float > ( const Point< float > &  pt)
inline

Definition at line 653 of file type.h.

Here is the call graph for this function:

◆ normL2Sqr< int >()

template<>
int nndeploy::base::normL2Sqr< int > ( const Point< int > &  pt)
inline

Definition at line 649 of file type.h.

Here is the call graph for this function:

◆ openFile()

std::string nndeploy::base::openFile ( const std::string &  file_path)

◆ overflowPolicyToString()

std::string nndeploy::base::overflowPolicyToString ( QueueOverflowPolicy  src)

◆ parallelTypeToString()

std::string nndeploy::base::parallelTypeToString ( ParallelType  src)

◆ pixelTypeToString()

std::string nndeploy::base::pixelTypeToString ( PixelType  pixel_type)

◆ powerTypeToString()

std::string nndeploy::base::powerTypeToString ( PowerType  src)

◆ precisionTypeToString()

std::string nndeploy::base::precisionTypeToString ( PrecisionType  src)

◆ prettyJsonStr()

std::string nndeploy::base::prettyJsonStr ( const std::string &  json_str)

◆ printData() [1/2]

template<typename T >
void nndeploy::base::printData ( T *  data,
base::IntVector shape,
std::ostream &  stream = std::cout 
)

Definition at line 117 of file string.h.

Here is the call graph for this function:

◆ printData() [2/2]

template<typename T >
void nndeploy::base::printData ( T *  data,
size_t  size,
std::ostream &  stream = std::cout 
)

Definition at line 101 of file string.h.

◆ rectangleIntersectionArea()

double nndeploy::base::rectangleIntersectionArea ( const Rect2d a,
const Rect2d b 
)
inline

Finds out if there is any intersection between two rectangles.

mainly useful for language bindings

Parameters
rect1First rectangle
rect2Second rectangle
Returns
the area of the intersection

Definition at line 1168 of file type.h.

◆ removeAllFile()

void nndeploy::base::removeAllFile ( const std::string &  path)

◆ removeJsonBrackets()

std::string nndeploy::base::removeJsonBrackets ( const std::string &  json_str)

◆ saturate_cast< int >() [1/5]

template<>
int nndeploy::base::saturate_cast< int > ( double  v)
inline

Definition at line 260 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< int >() [2/5]

template<>
int nndeploy::base::saturate_cast< int > ( float  v)
inline

Definition at line 256 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< int >() [3/5]

template<>
int nndeploy::base::saturate_cast< int > ( int64_t  v)
inline

Definition at line 246 of file saturate_cast.h.

◆ saturate_cast< int >() [4/5]

template<>
int nndeploy::base::saturate_cast< int > ( uint64_t  v)
inline

Definition at line 252 of file saturate_cast.h.

◆ saturate_cast< int >() [5/5]

template<>
int nndeploy::base::saturate_cast< int > ( unsigned  v)
inline

Definition at line 242 of file saturate_cast.h.

◆ saturate_cast< int64_t >()

template<>
int64_t nndeploy::base::saturate_cast< int64_t > ( uint64_t  v)
inline

Definition at line 315 of file saturate_cast.h.

◆ saturate_cast< short >() [1/7]

template<>
short nndeploy::base::saturate_cast< short > ( double  v)
inline

Definition at line 226 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< short >() [2/7]

template<>
short nndeploy::base::saturate_cast< short > ( float  v)
inline

Definition at line 221 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< short >() [3/7]

template<>
short nndeploy::base::saturate_cast< short > ( int  v)
inline

Definition at line 211 of file saturate_cast.h.

◆ saturate_cast< short >() [4/7]

template<>
short nndeploy::base::saturate_cast< short > ( int64_t  v)
inline

Definition at line 231 of file saturate_cast.h.

◆ saturate_cast< short >() [5/7]

template<>
short nndeploy::base::saturate_cast< short > ( uint64_t  v)
inline

Definition at line 237 of file saturate_cast.h.

◆ saturate_cast< short >() [6/7]

template<>
short nndeploy::base::saturate_cast< short > ( unsigned short  v)
inline

Definition at line 207 of file saturate_cast.h.

◆ saturate_cast< short >() [7/7]

template<>
short nndeploy::base::saturate_cast< short > ( unsigned  v)
inline

Definition at line 217 of file saturate_cast.h.

◆ saturate_cast< signed char >() [1/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( double  v)
inline

Definition at line 151 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< signed char >() [2/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( float  v)
inline

Definition at line 146 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< signed char >() [3/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( int  v)
inline

Definition at line 132 of file saturate_cast.h.

◆ saturate_cast< signed char >() [4/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( int64_t  v)
inline

Definition at line 156 of file saturate_cast.h.

◆ saturate_cast< signed char >() [5/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( short  v)
inline

Definition at line 138 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< signed char >() [6/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( uint64_t  v)
inline

Definition at line 163 of file saturate_cast.h.

◆ saturate_cast< signed char >() [7/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( unsigned char  v)
inline

Definition at line 124 of file saturate_cast.h.

◆ saturate_cast< signed char >() [8/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( unsigned short  v)
inline

Definition at line 128 of file saturate_cast.h.

◆ saturate_cast< signed char >() [9/9]

template<>
signed char nndeploy::base::saturate_cast< signed char > ( unsigned  v)
inline

Definition at line 142 of file saturate_cast.h.

◆ saturate_cast< uint64_t >() [1/4]

template<>
uint64_t nndeploy::base::saturate_cast< uint64_t > ( int  v)
inline

Definition at line 306 of file saturate_cast.h.

◆ saturate_cast< uint64_t >() [2/4]

template<>
uint64_t nndeploy::base::saturate_cast< uint64_t > ( int64_t  v)
inline

Definition at line 310 of file saturate_cast.h.

◆ saturate_cast< uint64_t >() [3/4]

template<>
uint64_t nndeploy::base::saturate_cast< uint64_t > ( short  v)
inline

Definition at line 302 of file saturate_cast.h.

◆ saturate_cast< uint64_t >() [4/4]

template<>
uint64_t nndeploy::base::saturate_cast< uint64_t > ( signed char  v)
inline

Definition at line 298 of file saturate_cast.h.

◆ saturate_cast< unsigned >() [1/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( double  v)
inline

Definition at line 293 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned >() [2/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( float  v)
inline

Definition at line 289 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned >() [3/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( int  v)
inline

Definition at line 273 of file saturate_cast.h.

◆ saturate_cast< unsigned >() [4/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( int64_t  v)
inline

Definition at line 277 of file saturate_cast.h.

◆ saturate_cast< unsigned >() [5/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( short  v)
inline

Definition at line 269 of file saturate_cast.h.

◆ saturate_cast< unsigned >() [6/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( signed char  v)
inline

Definition at line 265 of file saturate_cast.h.

◆ saturate_cast< unsigned >() [7/7]

template<>
unsigned nndeploy::base::saturate_cast< unsigned > ( uint64_t  v)
inline

Definition at line 283 of file saturate_cast.h.

◆ saturate_cast< unsigned char >() [1/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( double  v)
inline

Definition at line 108 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned char >() [2/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( float  v)
inline

Definition at line 103 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned char >() [3/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( int  v)
inline

Definition at line 91 of file saturate_cast.h.

◆ saturate_cast< unsigned char >() [4/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( int64_t  v)
inline

Definition at line 113 of file saturate_cast.h.

◆ saturate_cast< unsigned char >() [5/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( short  v)
inline

Definition at line 95 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned char >() [6/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( signed char  v)
inline

Definition at line 83 of file saturate_cast.h.

◆ saturate_cast< unsigned char >() [7/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( uint64_t  v)
inline

Definition at line 119 of file saturate_cast.h.

◆ saturate_cast< unsigned char >() [8/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( unsigned short  v)
inline

Definition at line 87 of file saturate_cast.h.

◆ saturate_cast< unsigned char >() [9/9]

template<>
unsigned char nndeploy::base::saturate_cast< unsigned char > ( unsigned  v)
inline

Definition at line 99 of file saturate_cast.h.

◆ saturate_cast< unsigned short >() [1/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( double  v)
inline

Definition at line 191 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned short >() [2/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( float  v)
inline

Definition at line 186 of file saturate_cast.h.

Here is the call graph for this function:

◆ saturate_cast< unsigned short >() [3/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( int  v)
inline

Definition at line 176 of file saturate_cast.h.

◆ saturate_cast< unsigned short >() [4/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( int64_t  v)
inline

Definition at line 196 of file saturate_cast.h.

◆ saturate_cast< unsigned short >() [5/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( short  v)
inline

Definition at line 172 of file saturate_cast.h.

◆ saturate_cast< unsigned short >() [6/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( signed char  v)
inline

Definition at line 168 of file saturate_cast.h.

◆ saturate_cast< unsigned short >() [7/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( uint64_t  v)
inline

Definition at line 202 of file saturate_cast.h.

◆ saturate_cast< unsigned short >() [8/8]

template<>
unsigned short nndeploy::base::saturate_cast< unsigned short > ( unsigned  v)
inline

Definition at line 182 of file saturate_cast.h.

◆ shapeCount()

size_t nndeploy::base::shapeCount ( const IntVector dims,
int  start_index = 0,
int  end_index = -1 
)

◆ shapeEqual()

bool nndeploy::base::shapeEqual ( const IntVector dims0,
const IntVector dims1,
int  start_index = 0,
int  end_index = -1 
)

◆ shapeMax()

IntVector nndeploy::base::shapeMax ( const IntVector dims0,
const IntVector dims1,
int  start_index = 0,
int  end_index = -1 
)

◆ shapeMin()

IntVector nndeploy::base::shapeMin ( const IntVector dims0,
const IntVector dims1,
int  start_index = 0,
int  end_index = -1 
)

◆ shapeNchw2Nhwc()

IntVector nndeploy::base::shapeNchw2Nhwc ( const IntVector dims)

◆ shapeNhwc2Nchw()

IntVector nndeploy::base::shapeNhwc2Nchw ( const IntVector dims)

◆ shareMemoryTypeToString()

std::string nndeploy::base::shareMemoryTypeToString ( ShareMemoryType  src)

◆ splitString()

std::vector<std::string> nndeploy::base::splitString ( const std::string &  str,
const std::string &  spstr 
)

◆ statusCodeToString()

std::string nndeploy::base::statusCodeToString ( StatusCode  code)

◆ stringToBorderType()

BorderType nndeploy::base::stringToBorderType ( const std::string &  border_type_str)

◆ stringToCodecFlag()

CodecFlag nndeploy::base::stringToCodecFlag ( const std::string &  src)

◆ stringToCodecType()

CodecType nndeploy::base::stringToCodecType ( const std::string &  src)

◆ stringToCvtColorType()

CvtColorType nndeploy::base::stringToCvtColorType ( const std::string &  cvt_color_type_str)

◆ stringToDataFormat()

DataFormat nndeploy::base::stringToDataFormat ( const std::string &  str)

◆ stringToDataType()

DataType nndeploy::base::stringToDataType ( const std::string &  str)

◆ stringToDataTypeCode()

DataTypeCode nndeploy::base::stringToDataTypeCode ( const std::string &  src)

◆ stringToDeviceType()

DeviceType nndeploy::base::stringToDeviceType ( const std::string &  src)

◆ stringToDeviceTypeCode()

DeviceTypeCode nndeploy::base::stringToDeviceTypeCode ( const std::string &  src)

◆ stringToEdgeType()

EdgeType nndeploy::base::stringToEdgeType ( const std::string &  src)

◆ stringToEdgeUpdateFlag()

EdgeUpdateFlag nndeploy::base::stringToEdgeUpdateFlag ( const std::string &  src)

◆ stringToEncryptType()

EncryptType nndeploy::base::stringToEncryptType ( const std::string &  src)

◆ stringToForwardOpType()

ForwardOpType nndeploy::base::stringToForwardOpType ( const std::string &  src)

◆ stringToInferenceOptLevel()

InferenceOptLevel nndeploy::base::stringToInferenceOptLevel ( const std::string &  src)

◆ stringToInferenceType()

InferenceType nndeploy::base::stringToInferenceType ( const std::string &  src)

◆ stringToInterpType()

InterpType nndeploy::base::stringToInterpType ( const std::string &  interp_type_str)

◆ stringToMemoryPoolType()

MemoryPoolType nndeploy::base::stringToMemoryPoolType ( const std::string &  src)

◆ stringToMemoryType()

MemoryType nndeploy::base::stringToMemoryType ( const std::string &  src)

◆ stringToModelType()

ModelType nndeploy::base::stringToModelType ( const std::string &  src)

◆ stringToNodeColorType()

NodeColorType nndeploy::base::stringToNodeColorType ( const std::string &  src)

◆ stringToOverflowPolicy()

QueueOverflowPolicy nndeploy::base::stringToOverflowPolicy ( const std::string &  src)

◆ stringToParallelType()

ParallelType nndeploy::base::stringToParallelType ( const std::string &  src)

◆ stringToPixelType()

PixelType nndeploy::base::stringToPixelType ( const std::string &  pixel_type_str)

◆ stringToPowerType()

PowerType nndeploy::base::stringToPowerType ( const std::string &  src)

◆ stringToPrecisionType()

PrecisionType nndeploy::base::stringToPrecisionType ( const std::string &  src)

◆ stringToShareMemoryType()

ShareMemoryType nndeploy::base::stringToShareMemoryType ( const std::string &  src)

◆ stringToTensorType()

TensorType nndeploy::base::stringToTensorType ( const std::string &  src)

◆ stringToTopoSortType()

TopoSortType nndeploy::base::stringToTopoSortType ( const std::string &  src)

◆ stringToWstring()

std::wstring nndeploy::base::stringToWstring ( const std::string &  str)

◆ tensorTypeToString()

std::string nndeploy::base::tensorTypeToString ( TensorType  src)

◆ timePointEnd()

void nndeploy::base::timePointEnd ( const std::string &  key)

◆ timePointStart()

void nndeploy::base::timePointStart ( const std::string &  key)

◆ timeProfilerGetAverageTime()

float nndeploy::base::timeProfilerGetAverageTime ( const std::string &  key)

◆ timeProfilerGetCostTime()

float nndeploy::base::timeProfilerGetCostTime ( const std::string &  key)

◆ timeProfilerPrint()

void nndeploy::base::timeProfilerPrint ( const std::string &  title = "")

◆ timeProfilerPrintIndex()

void nndeploy::base::timeProfilerPrintIndex ( const std::string &  title,
uint64_t  index 
)

◆ timeProfilerPrintRemoveWarmup()

void nndeploy::base::timeProfilerPrintRemoveWarmup ( const std::string &  title,
uint64_t  warmup_times 
)

◆ timeProfilerReset()

void nndeploy::base::timeProfilerReset ( )

◆ topoSortTypeToString()

std::string nndeploy::base::topoSortTypeToString ( TopoSortType  src)

◆ toString()

template<typename T >
std::string nndeploy::base::toString ( value)

Definition at line 25 of file string.h.

◆ ucharToString()

std::string nndeploy::base::ucharToString ( const unsigned char *  buffer,
int  length 
)

◆ vectorToString()

template<typename T >
std::string nndeploy::base::vectorToString ( std::vector< T >  val)

Definition at line 32 of file string.h.

◆ wstringToString()

std::string nndeploy::base::wstringToString ( const std::wstring &  wstr)