Skip to content

Commit

Permalink
Fix the bug: tensorrt-cpp input blob from BGR to RGB Megvii-BaseDetec…
Browse files Browse the repository at this point in the history
  • Loading branch information
rpehkone committed Apr 15, 2024
1 parent 953037f commit 2360277
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demo/TensorRT/cpp/yolox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ float* blobFromImage(cv::Mat& img){
{
for (size_t w = 0; w < img_w; w++)
{
blob[c * img_w * img_h + h * img_w + w] =
size_t invc = ((size_t)channels - 1) - c;
blob[invc * img_w * img_h + h * img_w + w] =
(float)img.at<cv::Vec3b>(h, w)[c];
}
}
Expand Down

0 comments on commit 2360277

Please sign in to comment.