Input to YOLO model

I am in a need to run the YOLO model outside DS. I am trying to understand what input to submit to the model, and kind of lost.

I got the engine file generated from the example. It works fine with the DS example (BTW im using fp16, and yolo416x416). I see in the queueInputBatch::nvinfer_context_impl.cpp that NvDsInferConvert_C4ToP3Float() is called, but when I try to follow it, I get different values (I am aware this is a device func., I moved the code to host and still not got it correct).

Example code might be clearer:

VideoCapture cap("/path/to/sample_1080p_h264.mp4");
cap >> img;
cv::Mat img_resized;
cv::resize(img, img_resized,cv::Size(416, 416));
std::vector<cv::Mat> channels(3);
cv::split(img_resized, channels); // channels are B G R 
float* hostDataBuffer = static_cast<float*>(buffers.getHostBuffer("data")); // size if 416x416x3

<<<<< NEED SOME MAGIC HERE, TO COPY channels DATA TO hostDataBuffer. CAN BE DEVICE MAGIC ALSO,
IF EASIER >>>>>

buffers.copyInputToDevice();
bool status = context->execute(batchSize, buffers.getDeviceBindings().data());

Any ideas ?

Hi,

Suppose the input should be arranged in RGB and defined in NCHW format.
Would you mind to give it a try first?
It looks like you are using BGR+NHWC right now.

Thanks.

working great, thanks.