FastDeploy  latest
Fast & Easy to Deploy!
Namespaces | Classes | Enumerations | Functions
fastdeploy Namespace Reference

All C++ FastDeploy APIs are defined inside this namespace. More...

Namespaces

 benchmark
 All C++ FastDeploy benchmark profile APIs are defined inside this namespace.
 
 function
 All C++ FDTensor Operation APIs are defined inside this namespace.
 
 pipeline
 All pipeline model APIs are defined inside this namespace.
 
 vision
 All C++ FastDeploy Vision Models APIs are defined inside this namespace.
 

Classes

class  FastDeployModel
 Base model object for all the vision models. More...
 
struct  FDTensor
 FDTensor object used to represend data matrix. More...
 
struct  IpuOption
 Option object to configure GraphCore IPU. More...
 
struct  LiteBackendOption
 Option object to configure Paddle Lite backend. More...
 
struct  OpenVINOBackendOption
 Option object to configure OpenVINO backend. More...
 
struct  OrtBackendOption
 Option object to configure ONNX Runtime backend. More...
 
struct  PaddleBackendOption
 Option object to configure Paddle Inference backend. More...
 
struct  PorosBackendOption
 Option object to configure Poros backend. More...
 
struct  Runtime
 Runtime object used to inference the loaded model on different devices. More...
 
struct  RuntimeOption
 Option object used when create a new Runtime object. More...
 
struct  TensorInfo
 Information of Tensor. More...
 
struct  TrtBackendOption
 Option object to configure TensorRT backend. More...
 

Enumerations

enum  LitePowerMode {
  LITE_POWER_HIGH = 0, LITE_POWER_LOW = 1, LITE_POWER_FULL = 2, LITE_POWER_NO_BIND = 3,
  LITE_POWER_RAND_HIGH = 4, LITE_POWER_RAND_LOW = 5
}
 
enum  Backend {
  UNKNOWN , TRT, PDINFER, POROS,
  OPENVINO, LITE, RKNPU2, SOPHGOTPU
}
 
enum  ModelFormat {
  AUTOREC, PADDLE, ONNX, RKNN,
  TORCHSCRIPT, SOPHGO
}
 

Functions

FASTDEPLOY_DECL int CheckStreamEncrypted (std::istream &cipher_stream)
 check stream is encrypted or not More...
 
FASTDEPLOY_DECL int DecryptStream (std::istream &cipher_stream, std::ostream &plain_stream, const std::string &key_base64)
 decrypt an encrypted stream More...
 
FASTDEPLOY_DECL std::string Decrypt (const std::string &cipher, const std::string &key)
 decrypt an encrypted string More...
 
FASTDEPLOY_DECL std::string GenerateRandomKey ()
 generate a random key(base64-32bytes) for an encrypted model More...
 
FASTDEPLOY_DECL int EncryptStream (const std::string &keydata, std::istream &in_stream, std::ostream &out_stream)
 encrypt a std::istream with key More...
 
FASTDEPLOY_DECL std::vector< std::string > Encrypt (const std::string &input, const std::string &key=GenerateRandomKey())
 encrypt a string with key More...
 
void PaddleTensorToFDTensor (std::unique_ptr< paddle_infer::Tensor > &tensor, FDTensor *fd_tensor, bool copy_to_fd)
 else share memory to FDTensor
 
std::vector< BackendGetAvailableBackends ()
 Get all the available inference backend in FastDeploy.
 
bool IsBackendAvailable (const Backend &backend)
 Check if the inference backend available.
 
void SetLogger (bool enable_info=true, bool enable_warning=true)
 Set behaviour of logging while using FastDeploy.
 

Detailed Description

All C++ FastDeploy APIs are defined inside this namespace.

Enumeration Type Documentation

◆ Backend

Inference backend supported in FastDeploy

Enumerator
UNKNOWN 

Unknown inference backend.

TRT 

TensorRT, support Paddle/ONNX format model, Nvidia GPU only.

PDINFER 

Paddle Inference, support Paddle format model, CPU / Nvidia GPU.

POROS 

Poros, support TorchScript format model, CPU / Nvidia GPU.

OPENVINO 

Intel OpenVINO, support Paddle/ONNX format, CPU only.

LITE 

Paddle Lite, support Paddle format model, ARM CPU only.

RKNPU2 

RKNPU2, support RKNN format model, Rockchip NPU only.

SOPHGOTPU 

SOPHGOTPU, support SOPHGO format model, Sophgo TPU only.

◆ LitePowerMode

Paddle Lite power mode for mobile device.

Enumerator
LITE_POWER_HIGH 

Use Lite Backend with high power mode.

LITE_POWER_LOW 

Use Lite Backend with low power mode.

LITE_POWER_FULL 

Use Lite Backend with full power mode.

LITE_POWER_NO_BIND 

Use Lite Backend with no bind power mode.

LITE_POWER_RAND_HIGH 

Use Lite Backend with rand high mode.

LITE_POWER_RAND_LOW 

Use Lite Backend with rand low power mode.

◆ ModelFormat

Deep learning model format

Enumerator
AUTOREC 

Auto recognize the model format by model file name.

PADDLE 

Model with paddlepaddle format.

ONNX 

Model with ONNX format.

RKNN 

Model with RKNN format.

TORCHSCRIPT 

Model with TorchScript format.

SOPHGO 

Model with SOPHGO format.

Function Documentation

◆ CheckStreamEncrypted()

int fastdeploy::CheckStreamEncrypted ( std::istream &  cipher_stream)

check stream is encrypted or not

Parameters
[in]cipher_streamThe encrypted stream
Returns
0 if stream is encrypted.

0 - encrypted 1 - unencrypt

◆ Decrypt()

std::string fastdeploy::Decrypt ( const std::string &  cipher,
const std::string &  key 
)

decrypt an encrypted string

Parameters
[in]cipherThe encrypted string
[in]keyThe key for decryption
Returns
The decrypted string

◆ DecryptStream()

int fastdeploy::DecryptStream ( std::istream &  cipher_stream,
std::ostream &  plain_stream,
const std::string &  key_base64 
)

decrypt an encrypted stream

Parameters
[in]cipher_streamThe encrypted stream
[in]plain_streamThe decrypted stream
[in]key_base64The key for decryption
Returns
0 if decrypt success.

◆ Encrypt()

std::vector< std::string > fastdeploy::Encrypt ( const std::string &  input,
const std::string &  key = GenerateRandomKey() 
)

encrypt a string with key

Parameters
[in]inputThe input string for encryption
[in]keyIf not given by user, generate key automatically.
Returns
std::vector<std::string> [encrypted string, key]

◆ EncryptStream()

FASTDEPLOY_DECL int fastdeploy::EncryptStream ( const std::string &  keydata,
std::istream &  in_stream,
std::ostream &  out_stream 
)

encrypt a std::istream with key

Parameters
[in]keydataThe key(base64-32bytes) for encryption
[in]in_streamThe plain stream
[in]out_streamThe ecrypted stream
Returns
true if encrypt successed, otherwise false

◆ GenerateRandomKey()

std::string fastdeploy::GenerateRandomKey ( )

generate a random key(base64-32bytes) for an encrypted model

Returns
std::string key