From 022e240a96a20bd17a06dd7060fccf98f1667227 Mon Sep 17 00:00:00 2001 From: Dustin Franklin Date: Wed, 26 Apr 2023 22:08:41 -0400 Subject: [PATCH] copy input to output in poseNet.Overlay() --- c/poseNet.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/c/poseNet.cpp b/c/poseNet.cpp index 1ce8df97d..060c98653 100644 --- a/c/poseNet.cpp +++ b/c/poseNet.cpp @@ -677,6 +677,15 @@ bool poseNet::Overlay( void* input, void* output, uint32_t width, uint32_t heigh if( overlay == OVERLAY_NONE ) return true; + if( input != output ) + { + if( CUDA_FAILED(cudaMemcpy(output, input, imageFormatSize(format, width, height), cudaMemcpyDeviceToDevice)) ) + { + LogError(LOG_TRT "poseNet -- Overlay() failed to copy input image to output image\n"); + return false; + } + } + const uint32_t numObjects = poses.size(); const float line_width = MAX(MAX(width,height) * mLinkScale, 1.5f);