17 #ifndef MOVIDIUS_NCS_LIB_TENSOR_H 18 #define MOVIDIUS_NCS_LIB_TENSOR_H 24 #include <opencv2/opencv.hpp> 32 using Ptr = std::shared_ptr<Tensor>;
33 using ConstPtr = std::shared_ptr<Tensor const>;
35 Tensor(
const std::pair<int, int>& net_dim,
36 const std::vector<float>& mean,
42 inline const uint16_t*
raw()
const 46 inline const size_t size()
const 59 static void fp32tofp16(uint16_t* __restrict out,
float in);
60 static void fp16tofp32(
float* __restrict out, uint16_t in);
74 #endif // MOVIDIUS_NCS_LIB_TENSOR_H const size_t size() const
static void fp16tofp32(float *__restrict out, uint16_t in)
std::shared_ptr< Tensor > Ptr
const uint16_t * raw() const
Tensor(const std::pair< int, int > &net_dim, const std::vector< float > &mean, const float &scale)
std::shared_ptr< Tensor const > ConstPtr
static void fp32tofp16(uint16_t *__restrict out, float in)
void loadImageData(const cv::Mat &image)
std::vector< uint16_t > tensor_
std::vector< float > mean_