Closed louisme87 closed 2 years ago
Hello, I'm using cppflow recently and has some questions. Here is part of my code, and I don't know how to parse the opencv's Mat image to Tensor.
img = imread("123.jpg"); resize(img, resized_img, Size(416, 416), INTER_LINEAR); vector<uint8_t> img_data; auto e = begin(img_data); img_data.insert(e, resized_img.data, resized_img.data + resized_img.total() * 3); auto input = cppflow::tensor(img_data, { 3, 416, 416 }); input = cppflow::cast(input, TF_UINT8, TF_FLOAT); input = cppflow::expand_dims(input, 0);
Hi @louisme87
What is exactly your problem? You don't know how to convert cv::Mat to cppflow::tensor?
cv::Mat
cppflow::tensor
Hello, I'm using cppflow recently and has some questions. Here is part of my code, and I don't know how to parse the opencv's Mat image to Tensor.