Use CPU resize before upload to GPU to remove PCIe bottleneck
This commit is contained in:
@@ -178,10 +178,10 @@ std::vector<TextBox> RTOCRDetector::Detect(const cv::Mat& image,
|
||||
}
|
||||
|
||||
if (!usedNV12) {
|
||||
// Fallback: standard BGR upload
|
||||
cv::cuda::GpuMat gpuImg;
|
||||
gpuImg.upload(image);
|
||||
cv::cuda::resize(gpuImg, gpuResized, resizeShape);
|
||||
// Fallback: CPU resize then upload small image to GPU
|
||||
cv::Mat cpuResized;
|
||||
cv::resize(image, cpuResized, resizeShape, 0, 0, cv::INTER_LINEAR);
|
||||
gpuResized.upload(cpuResized);
|
||||
}
|
||||
|
||||
// Keep BGR order (PaddleOCR official does NOT convert BGR->RGB)
|
||||
|
||||
Reference in New Issue
Block a user