libtorch-yolov3
libtorch-yolov3 copied to clipboard
Libtorch batch input
I have a question. In inference stage, I want to set batch to four, processing four channels of video at the same time. How should I do? Thank you !
Input data are supposed to be NHWC format in Pytorch, in the example, N = 1:
auto img_tensor = torch::CPU(torch::kFloat32).tensorFromBlob(img_float.data, {1, input_image_size, input_image_size, 3});
So you should create a tensor with four images data, and the "write_results" function should be updated too.
I'm sorry that I‘m not very clear it. Do you think I am writing this right? at::Tensor img_tensor = torch::from_blob(img1.data, img2.data, img3.data, img4.data, {1, input_image_size, input_image_size, 3}); Or, do you mind writing one for me? Thank you very much!